change navigator to window.navigator