adding event to js