added window clouse event listener