A Sacramento-based Third District Court of Appeals has overturned the 2017 conviction of five men who were caught with marijuana in their prison cells, after California passed Proposition 64 legalizing recreational use of the drug.

But that doesn’t mean inmates can light up joints while behind bars.

In his opinion, Presiding Justice Vance W. Raye said while state penal code prohibits smoking or eating marijuana while incarcerated it does not address possession. This would mean that inmates who are found to possess marijuana would not face additional charges on top of the ones they are serving.

Correctional officials, however, made clear drug use in prisons would not be tolerated.

“While the court’s decision is still under review, we want to be clear that drug use and sales within state prisons remain prohibited,” California Department of Corrections and Rehabilitation spokesperson Vicky Waters said in a Politico report addressing the decision. “CDCR is committed to providing a safe, accountable environment for prisoners and staff alike and we plan to evaluate this decision with an eye towards maintaining health and security within our institutions.”

It is up to the state attorney general to decide whether to appeal the decision to the California Supreme Court.

David Lynch, who works in the Sacramento Country Public Defender’s Office, said the decision “will prevent inmates from having years added to their sentences for simple possession, reducing overcrowding and saving $50,000-75,000 a year in unnecessary costs.”

The new law does limit the amount of marijuana one can possess for personal use.