fix for removing event listener