Fix bug in animation