Ireland has accidentally legalized ecstasy, magic mushrooms and a number of other drugs as of this morning.

The Irish parliament (Dáil) is working to pass emergency legislation that will restore their illegal classification, but the earliest it will go into effect is Thursday at 12am.

This morning, Ireland’s 1977 Misuse of Drugs Act was found illegal by the Irish Court of Appeal.

As The Journal reports, “The court ruling found that the 1977 Act was being added to via ministerial order without recourse to the Oireachtas, in violation of article 15 of the Constitution.

“Ministerial orders had been used nine times since the Act’s inception to outlaw the possession of drugs like ecstasy, ketamine, magic mushrooms, benzos and other drugs.”

The Dáil will sit late tonight as it works on emergency legislation to repair this loophole. It will then go to the Seanad, the upper house of the Irish legislature, tomorrow, and likely go into effect Thursday at 12am.

One of the bills postponed by this emergency legislation, The Journal reports, is the private member’s bill by Sinn Fein, which calls for emigrants to be allowed vote in presidential elections. It has been postponed until tomorrow evening.

The Irish Mirror reports that Taoiseach Enda Kenny will address concerns about this loophole later today.