change fsm to state module