prevent adding the event listener twice