adjust directory, and add StateMachine