SACRAMENTO (AP) — California prison officials said Wednesday that they will change the rules for using pepper spray on mentally ill inmates, as a federal judge considers whether current practices violate inmates’ civil rights.

The corrections department will limit how much pepper spray can be used and how quickly, said spokeswoman Deborah Hoffman. The rules are still being written and would not apply to emergency situations.

READ MORE: 4 Arrests Made In Connection With Lakewood Flash Mob Burglary Of Home Depot

The state’s announcement comes as U.S. District Judge Lawrence Karlton ordered corrections officials to publicly release videos that show prison guards pumping rounds of pepper spray into the cells of mentally disturbed inmates, some of whom begin shrieking or yelling for help.

The videos were shown during a hearing over the use of force against mentally ill inmates. The state’s own expert said in court documents that guards routinely use canisters of pepper spray the size of a fire extinguisher on unarmed inmates when a much smaller quantity could be used.

“Obviously, it’s our goal to use a minimal amount of force. Having it spelled out may help these situations stay more in control,” Hoffman said.

Michael Bien, one of the attorneys representing mentally ill inmates, praised the move but said it doesn’t go far enough.

READ MORE: Flyers Containing Hate Speech Related To Jewish People Distributed To Beverly Hills Homes

“It’s a big step, and I think that it’s a significant admission that the department needed to reform,” he said.

However, the department is “kind of fine-tuning how they use pepper spray” instead if questioning whether “this the type of weapon they ought to be using or are there other ways to avoid use of force?”

The weekslong hearing grew out of Karlton’s decision in April to reject Gov. Jerry Brown’s effort to end court oversight of prison mental health treatment. In the course of contesting that move, Bien said attorneys representing mentally ill inmates discovered new problems.

A separate ongoing federal lawsuit challenges the state’s medical treatment of inmates. Both cases prompted federal judges to rule that overcrowding is the main source of inadequate care, forcing the state to greatly reduce its prison population.

MORE NEWS: Virgil Abloh, Louis Vuitton Artistic Director And Off-White Founder, Dies Of Cancer At 41

(© Copyright 2013 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)