fixed C state machine (getting stuck in STATE_ML2)