fixed bug in destroying categories