CARROLLTON, Ga. — The gunman responsible for last week’s deadly attack in a Louisiana movie theater was delivered by deputies to hospital for a mental evaluation in 2008 after his family said he was a danger to himself and others.

But the judge who ordered John Russell Houser detained said Monday that she did not have him involuntarily committed, which may explain why he was able to legally purchase the gun he used to kill two people and wound nine others before killing himself.

Funerals were held Monday in Louisiana for Jillian Johnson and Mayci Marie Breaux, the two women killed when Houser opened fire in a theater in the city of Lafayette.

Houser’s case underscores the concerns raised in the aftermath of other mass shootings involving suspects with mental health issues – and the gaps in the system meant to “red-flag” people ill-suited to own or carry a firearm.

While an Alabama sheriff said that he denied Houser’s application for a concealed weapons’ permit in 2006, there appears to have been nothing in court filings that would raise concerns in the FBI background check system.

Contrary to legal filings by Houser’s family, Carroll County Probate Judge Betty Cason said she did not order Houser to be involuntarily committed for mental health treatment at the West Central Regional Hospital in Columbus, Georgia, which is in Muscogee County, where she lacks jurisdiction.

Doctors at the hospital would have had to petition that county’s probate judge for such a commitment, so “it wouldn’t have come through me,” Cason told The Associated Press.

This might explain why Houser passed a federal background check in February 2014 allowing him to buy the .40-caliber handgun, despite years of erratic and menacing behavior.

Houser’s federal background check came back clean, according to a lawyer for the pawn shop where he bought the weapon, Money Miser Northside Pawn in Phenix City.

“We know ATF reviewed our sale and said everything is right on our side,” said the store’s attorney Eric B. Funderburk.

Cason said she did sign an order on April 22, 2008, authorizing deputies to detain Houser and take him, against his will if necessary, to a treatment facility for a mental health evaluation.

That order would have allowed medical authorities to examine Houser for up to five days. Afterward, doctors would have had to either release Houser, convince him to voluntarily commit himself for treatment, or ask the Muscogee County Probate Court to force him to undergo treatment over a longer period.