Some changes for AIStateMachine