Fixed animation delay when changing animation state.