event doesn't correctly unload when changing class