Changed setInterval to setTimeout