check if equal to $window instead of window.