Washington Gov. Jay Inslee signed a bill Wednesday that would require licensed gun dealers to notify state police when someone fails a background check while trying to purchase a firearm.

The Seattle Times reported the new law, formerly known as HB 1501, will take effect in July 2017 and will require firearms dealers to notify the Washington Association of Sheriffs and Police Chiefs within five days of a failed background check. Washington State Patrol will then record that information in a database, made accessible to other state law enforcement agencies.

“This will not just keep guns out of the hands of those who are not eligible to have them, but keep the public and our law-enforcement officers safe,” Inslee said while signing the bill.

The measure, which passed unanimously in the Republican-controlled Senate and by a 83-13 vote in the House, would also allow state police to develop a grant program to investigate denials.

“We want there to be criminal consequences if you knowingly, illegally try to purchase a firearm,” said Democratic Rep. Drew Hansen, one of the bill’s sponsors. “There’s no mechanism for that to happen right now. This bill creates that mechanism.”

The new law also calls for the creation of a notification system so that people who have obtained a stalking, sexual assault, domestic violence or other court-protection order against someone will be notified if the person subject to the court order fails a background check when trying to purchase a gun.

While gun control advocates have cheered the measure, those opposed to the new law have argued many people are falsely denied a purchase of a firearm through NICS checks, errors that can take months, or in some cases even years, to clear up.