add $window as dependency