update animations and use setInterval instead of setTimout