use window.setTimeout() instead of .setTimeout()