fix a bug in animation