Fixed infinite animation bug