added setInterval, but it only runs once, not at intervals as expected