added setTimeout loop to index.html