Ireland has legalized a number of drugs, including ecstasy and crystal meth, by an accidental loophole in the law, reports The Journal.

The report said that the country’s 1977 Misuse of Drugs Act was found unconstitutional by the Irish Court of Appeal on Tuesday morning (March 10), which means that the drugs currently prohibited in it are now legal.

They include ecstasy, crystal meth and ketamine. However, drugs like heroin, cocaine and cannabis are not affected by the law.

Due to the loophole, the Irish government is currently preparing emergency legislation to fix this loophole. But, no matter how fast they fix the law, it “can only take effect on the day after its signed into law,” meaning the drugs will remain legal in Ireland until 12AM Thursday (March 12) at the earliest.

According to The Journal, the Irish government has released a statement admitting that while it “does not affect existing laws regarding the supply, possession or sale” of heroin, cocaine and cannabis, “it does affect the possession of certain newer psychoative substances.”

Drug dealers, however, can still be prosecuted. “We are advised that the sale and supply of psychoative substances remains an offence under existing legislation,” the statement adds.