fixed a bug where nextState() didn't save its updated flow network