DMX avoided going to prison Wednesday in Hackensack, N.J., by pleading guilty to 13 counts of animal cruelty, two counts of maintaining a nuisance, one count of possession of drug paraphernalia and one count of disorderly conduct. “I’m just glad it’s over,” DMX said in an interview with The Record of Hackensack. In exchange for Bergen County prosecutors dropping weapons and child endangerment charges, DMX is required to produce public service announcements that teach kids the dangers of guns and tells them to treat animals nicely.

X was hit with the charges in June 1999 after police searched his home and found a semiautomatic weapon, a bulletproof vest, hollowpoint bullets, an extra-capacity gun clip, six “used glass cocaine-smoking pipes” and 14 pit bulls.

Authorities were led to the house after finding a purse belonging to DMX’s wife, Tashera Simmons, near the scene of a shooting that left X’s manager and uncle, Ray Copeland, with a bullet wound to the foot.

Once police arrived at the house, Tashera’s mother, Marcia Tate, allegedly told them that DMX was under the influence of drugs and had pulled out a pistol. The fact that X and Tashera’s 6-year-old son and a 15-year-old cousin were present at the time led to the child endangerment charges. However, Tate refused to cooperate with prosecutors, preventing the case from going to trial this week and leading to the plea bargain. As part of the deal, weapons and child endangerment charges against Tashera were dropped as well.