fix adding event listeners