fix the bug of FSM detection