fixed for window.addListener