A full investigation is now underway into why a former Air Force enlisted man’s conviction on domestic violence charges was not forwarded to the FBI for inclusion in a national database, which should have prevented him from buying guns legally.

But the answer may be written in black and white in the pages of the Uniform Code of Military Justice, the law governing the U.S. military.

Under federal law, the 1996 Domestic Violence Offender Gun Ban, anyone convicted of a crime of domestic violence, even a misdemeanor offense, is barred from buying or owning a firearm.

In 2012, Devin Patrick Kelley was convicted of two counts of assaulting his then-wife and his infant stepson, so it should apply to him.

But under military law, there is no specific offense of “domestic violence” or “domestic abuse.”

So Kelley was court-martialed under Article 128 of the UCMJ, which covers a range of assault, but makes no reference to the circumstance of assault within a marriage or domestic situation.

At least one member of the House Armed Services Committee believes that is likely why Kelley’s conviction may have fallen through the cracks.

“I am not convinced that the Air Force, nor its sister services actually have a charge of domestic violence like we do in civil court or civilian court,” Rep. Donald McEachin told CNN Wednesday. “They sort of lump it all under assault and if it's not clear to the person or the clerk that's putting into the database which type of assault it is, which it can easily be misunderstood or lost in that sort of a scenario, that's how these things happen.”

McEachin says Congress may need to amend the UCMJ to add a specific offense of domestic violence and spouse abuse.

Two senators have since introduced a bill that would require the military to report domestic violence to federal authorities within three days of a judgment. If the service misses that deadline, it has to explain to Congress why that happened.

“It appears this loophole allowed a man who was clearly unfit to purchase a firearm to do so at the cost of 26 innocent lives,” Flake said in a release announcing the bill. “This bill will ensure that a situation like this will not happen again and that anyone, anywhere convicted of domestic violence is kept from legally purchasing a gun.”

The military does seem to do a better job of reporting dishonorable discharges, which is also a disqualifying factor in gun ownership under federal law.

More than 11,000 names of military members dishonorably discharged are in the FBI database, according to figures obtained by NPR.

Kelley, the Texas church attacker, was given a bad conduct discharge, which is not considered as serious as a dishonorable discharge, despite the fact he spent a year in prison for his assault convictions.

Had Kelley’s name been in the federal database it would have prevented him from buying a gun legally from a licensed seller.