I think I fixed the event handler