added window event listener