Changed setInterval for setTimeout function