event listener bug fixing