fixed event.clear()s and removed debug statement