fixed readFn, replace, updateFn, patchFn