fix issues with events/classes not being removed