updating the event handlers to jQuery