March 10, 2015 12:33 PM EDT

The Irish legislature was scrambling Tuesday to pass an emergency measure after a loophole in a court decision legalized a host of drugs, including ecstasy and magic mushrooms.

The Irish Court of Appeal declared Tuesday morning that a section of the 1977 Misuse of Drugs Act, which regulated the now-legal drugs, unconstitutional, according to the Irish Times. A new bill criminalizing the drugs, if passed, will not take effect in the country until Thursday at 12 a.m.

“All substances controlled by means of Government Orders made under section 2(2) cease to be controlled with immediate effect, and their possession ceases to be an offence,” read a statement issued by Ireland’s Department of Health. “These include ecstasy, benzodiazepines and new psychoactive substances, so-called ‘headshop drugs.'”

It is, however, still illegal to sell the drugs. Other drugs that were outlawed with earlier legislation, like cocaine, heroin and marijuana, remain banned.

[The Irish Times]

Read next: This New Drug Turns ‘Bad’ White Fat Into ‘Good’ Brown Fat

Listen to the most important stories of the day.

Contact us at letters@time.com.

Read More From TIME

Related Stories

EDIT POST