fix several animation bugs