fix event listener memory leak