Prevents $window to be called before is available.