use $window module rather than global