use setTimeout instead of setInterval

For some reason the slider will never stop unless I use setTimeout instead of setInterval.