fixing event listeners