fixed saving/loading to support new format