bug fixed with state machine