fixed state building utils, so that they do not ignore previous state and can work for sandbox state building.