fix some finite state machine bug