Window event listening implemented