replaced window object in controller with angulars's $window. Just cuz it's angular.