diff --git a/segment_stack.go b/segment_stack.go
index <HASH>..<HASH> 100644
--- a/segment_stack.go
+++ b/segment_stack.go
@@ -216,10 +216,10 @@ OUTER:
 			}
 
 			if val == nil {
-				continue OUTER
+				op = OperationDel
+			} else {
+				op = OperationSet
 			}
-
-			op = OperationSet
 		}
 
 		err = mergedSegment.mutate(op, key, val)
merge op of nil val converted to OperationDel