Fix a bug in animation