fixed the animation bug