This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

JOHNSON COUNTY, Kan. — A man accused of child endangerment and abandonment of his wife’s corpse has been ordered to undergo a mental evaluation.

A Johnson County judge found Justin Rey to be incompetent to stand trial on Thursday.

Rey’s attorney filed a motion in November, saying Rey was unfit because he’s unable to fully understand the gravity of the charges against him.

The judge ordered Rey to go to Larned State Hospital. He’ll be there for 90 days to get treatment.

The 35-year-old is accused of dismembering his wife’s body in front of their two children in a Kansas City hotel room. He said Jessica Rey died from childbirth.

The child endangerment charge came after police said they found Rey and his children living in a Lenexa U-Haul storage unit with his wife’s remains in a cooler in October.

When he was arrested, police said Rey told them his wife delivered their baby in the bath tub of a hotel room near Interstate 70 and Stadium Drive, where they’d been staying since Sept. 25.

He told them he used a plastic fastener and a shoe string to secure the umbilical cord. He told police she died after childbirth and he placed her in the bed and then took pictures with his wife and kids together.

He said he spent two days with her body, Friday and Saturday, before dismembering her and then taking her body in the cooler to the storage facility in Lenexa.

Detectives said Rey admitted cutting up his wife in the bathtub and then putting her body parts in the cooler. What didn’t fit in the cooler, he said he flushed down the toilet or boiled in a pot on the stove.

Lenexa police were tipped off about Rey after the U-haul Storage Facility contacted them. They said he was suspiciously talking about his wife dying while giving birth to their newborn.  When police found him at the storage facility, they said he told them his wife had died from suicide after giving birth.

“The suspect spontaneously informed the officers his wife was inside the cooler and looked to the direction of a red and white Igloo style cooler with wheels,” the probable cause statement said.

When Rey initially went before a judge in Johnson County, Rey screamed out in court that his rights were being violated. He denied that he and his children were living in the storage unit. He also yelled that he is not mentally unstable.

Jackson County prosecutors requested a bond of $100,000 cash. Rey was also charged on Wednesday with murder in California.