fix bugs; both record and config data are copied from the object since the config object is collected by gc.