fix batchApply causes write problem