changed StateMachine to comply with newlly added states