Use window.setTimeout instead of setTimeout