turning engine in state machine