fixed issue of fsm