fix animation on state change