Despite lawmakers’ best efforts to thwart the clear desires of their constituents, Montana medical marijuana dispensaries are set to reopen thanks to intervention from a judge.

Montana was one of four states where voters approved medical marijuana initiatives on Election Day this year, though the Big Sky State’s was different—it didn’t create a medical-marijuana program, as voters had already done that in 2004.

What I-182 did was merely restore the state’s medical cannabis program to voters’ intent after the state Legislature gutted it in 2011.

That year, lawmakers imposed rules so strict—including limiting the number of patients per caregiver to three, making dispensaries economically impossible to operate—that left cannabis nearly impossible to access.

A lengthy court battle meant that the rules didn’t take effect until Aug. 31 of this year, but that still meant the closure of medical-marijuana dispensaries across the state and no access to cannabis for thousands of patients, according to the Missoulian.

The new rules winnowed the number of registered patients in the state to 7,558—down from more than 30,000—and of them, 6,557 were without a registered caregiver to grow or provide them marijuana.

I-182 struck down the three-patient limit and restored the dispensary model as workable. Confident of a reprieve on Election Day, hopeful dispensaries hung signs saying “See you in November.”

After the win, they then found themselves victims of a clerical error. Last-minute changes to the ballot initiative’s language meant that the law as written would not take effect until July 1 of next year.

It took the courts to inject some sanity into the situation. Judge James Reynolds found the clerical error to be just that, and ordered dispensaries to be able to reopen immediately, as was I-182’s intent.

The plight of sick patients was key for Reynolds, according to the Missoulian.

“The folks that are maybe the most in need are the least able to provide, to grow their own,” Reynolds said, according to the newspaper. “I think speed is more important than niceties.”

It wasn’t immediately clear if Reynolds’ decision would be appealed or by whom. State health department officials said they had no plans to appeal, which suggests the ruling is safe.

In the meantime, the Montana Cannabis Industry Association, which sponsored the ballot measure, says the state’s marijuana businesses are getting ready to return. One dispensary already announced its grand reopening on Facebook.

It may take some time, as dispensaries need to grow an adequate supply and it’s not clear how quickly physicians will sign off on new patients—but it appears they’ll work it out.

“The people who work providing marijuana in Montana were, let’s face it, they were jerked around quite a bit,” said MCIA lobbyist Kate Cholewa, in comments to the paper. “They are somewhat used to it and very good at coming back. “