Listen to window instead of document