Governor Jerry Brown signed a measure on Saturday closing a loophole in California law that allows some K-12 school personnel to carry their firearms in gun-free school zones.  

The new bill, which takes effect January 1, updates a 2015 law that gave district superintendents authority to decide if staffers with permits to carry concealed weapons could come to school armed. Five California districts had begun to issue authorizations for staffers to carry in gun-free school zones, according to Democratic Assemblyman Kevin McCarty of Sacramento, who authored the bill to remove that option.

“A safe learning environment is essential for our children to be successful in the classroom,” McCarty told reporters. “That’s not possible if a school district allows armed civilians to roam California school campuses.”

Critics of the new measure said it will leave school staffers helpless to stop an armed intruder on school grounds, which they argue could cost lives.

“You’re taking away the ability to protect our children,” Republican Assemblyman Devon Mathis of Visalia said. “People with concealed carry weapons are trained and schools are already soft targets.”

The California bill represents the latest back-and-forth in the battle over firearms on school grounds. Since the December 2012 massacre at Sandy Hook Elementary School in Newtown, Connecticut, gun-rights advocates, led by the National Rifle Association, have sought to increase the carrying of guns by school guards and school personnel, while gun-reform groups have worked to block those moves.

Since the Sandy Hook shooting, eight states – Georgia, Kansas, Missouri, Oklahoma, South Dakota, Tennessee, Texas and Wyoming – have passed laws aimed at arming teachers or other school staffers, according to Everytown For Gun Safety. (Everytown is a funder of The Trace.) Momentum for such bills has slowed, with just one of the 18 states to consider measures in 2017 voting through a new law. However, in many of the remaining states, local school officials retain some authority to grant staffers the right to carry in gun-free school zones, similar to California’s soon-to-expire law.

The loopholes have seeded a small industry of self-defense classes for school staffers. In Ohio, the Buckeye Firearms Foundation started its Armed Teacher Training Program in 2012. The foundation said that 1,048 teachers had applied for the training in the first year. This summer, a CBS News crew documented the group’s three-day training course, including an exercise involving a simulated armed shooter in which a student was accidentally shot by a staffer.

Jim Irvine, the president of the Buckeye Firearms Foundation, defended the mishap as a mistake best made in training, before a true life-and-death situation. “The purpose of training is to learn,” he said in a statement posted to the group’s website. “An emergency is a terrible time to improvise.”