fix for applyEdits bug