Alabama’s Republican governor on Wednesday moved to end a decades-old practice that allowed the state’s sheriffs to pocket money set aside to pay for inmates’ meals.

Gov. Kay Ivey sent a memorandum to the state comptroller announcing this shift in policy, and released a statement saying that funds bookmarked for jail food should no longer be seen as “personal income for sheriffs.”

“Public funds should be used for public purposes—it’s that simple,” Ivey said.

Under a state law passed before World War II, sheriffs are allowed to keep any excess taxpayer dollars set aside to feed the inmates they oversee. The definition of “excess” is left up to the sheriffs’ own discretion, creating a system ripe for abuse.

In 2009, the Morgan County sheriff was jailed by a federal judge for keeping over $200,000 while feeding prisoners inadequate meals, including a weeks-long stretch where they received only corn dogs.

The practice drew renewed scrutiny this year thanks to a series of exposés in AL.com, which reported that former Etowah County Sheriff Todd Entrekin purchased a $740,000 beach house after pocketing over $750,000 in jail food funds. Another, who is caught up in a web of criminal probes, invested $150,000 of the funds in a used-car dealership owned by a former felon.

Local sheriffs have justified by the practice by pointing out that the practice is legal. Entrekin called the allegations against him “fake news” promoted by the “liberal media.”

The Alabama Sheriffs Association did not immediately return TPM’s request for comment.

But Ivey’s order is not the final word on the jail food money. Her order, which notes that previous Alabama attorneys general had reached conflicting opinions on how the funds can be spent, could be challenged by lawsuits.

Ivey pointed to the most recent 2011 decision handed down by Luther Strange to bolster her claim that both the law and attorney general’s opinion are “clear.” She urged the legislature to pass a law codifying the change in policy in the next session.

“I have changed the way these funds are handled because it is the right thing to do,” the governor said.