Changed up the event handler