fixed state_by_node2state_by_state bug