Fixed an issue with looping animations