Using setTimeout instead of setInterval, to possibly fix bug where browsers hang.