Updating event listener code