fix null object error when an event is removed between checks