Last week, DMX was placed on house arrest after violating bond conditions stemming from his tax evasion case. The rapper requested the terms be lightened in order to travel for performance gigs, but instead he’ll be getting off of house arrest for a different reason.

According to TMZ, a judge signed off on a deal that will allow DMX to leave the house without wearing an ankle monitor—but only if and when traveling to a rehab center for substance abuse.

It wasn’t only X’s bond violations (of visiting St. Louis and Chicago without approval) that led to his house arrest, but also his four failed drug tests for cocaine, opiates, and marijuana. At the time of his arrest for the tax fraud, he claimed he would remain sober.

TMZ reports that X will still have to request permission to travel outside of New York, but can go to the treatment facility without issue.

According to the site, X’s attorney, Murray Richman, said the rapper’s drug usage had become impossible to manage.