SPRINGFIELD, Ill. — Illinois lawmakers on Tuesday were trying to close a legal loophole that allowed a confiscated AR-15 semiautomatic rifle to be given back to the man accused of a shooting at a Waffle House restaurant in Tennessee that killed four and wounded four.

Illinois state police revoked the gun license of Travis Reinking and his firearms were transferred to his father after U.S. Secret Service agents arrested him last year for being in a restricted area near the White House. The 29-year-old Reinking, who had a troubled past, said he wanted to meet President Donald Trump.

Reinking’s father subsequently gave the guns back to him. The proposed measure would make it a felony to give the guns back.

The Illinois legislature is also working on a separate bill to permit families of troubled individuals who are a danger to themselves or others to have guns removed temporarily from that person’s home.

Illinois is one of the few U.S. states that requires residents to have a licence or permit to own a gun and is among a minority of U.S. states that requires gun owners to give up firearms if their rights to own them are revoked.

Morrison’s legislation would require a person taking possession of guns to sign an affidavit acknowledging that it is a felony to give a firearm to a person who does not have a valid Firearm Owner’s Identification (FOID) gun permit.

The proposed legislation goes some way towards closing a loophole identified by gun control groups.