fixing event-handler