fix a bug for animation