make sure to close hdf5 file in restore()