diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 65daf27..4973b63 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -547,12 +547,17 @@ btmarkpos(PG_FUNCTION_ARGS)
 	BTScanOpaque so = (BTScanOpaque) scan->opaque;
 
 	hoge_markpos_count++;
-	memcpy(&so->markPos, &so->currPos,
-		   offsetof(BTScanPosData, items[1]) +
-		   so->currPos.lastItem * sizeof(BTScanPosItem));
-	if (so->markTuples)
-		memcpy(so->markTuples, so->currTuples,
-			   so->currPos.nextTupleOffset);
+//	memcpy(&so->markPos, &so->currPos,
+//		   offsetof(BTScanPosData, items[1]) +
+//		   so->currPos.lastItem * sizeof(BTScanPosItem));
+//	if (so->markTuples)
+//		memcpy(so->markTuples, so->currTuples,
+//			   so->currPos.nextTupleOffset);
+	if (BTScanPosIsValid(so->markPos))
+	{
+		ReleaseBuffer(so->markPos.buf);
+		so->markPos.buf = InvalidBuffer;
+	}
 
 	/* We don't take out an extra pin for the mark position. */
 	so->markPos.buf = InvalidBuffer;
@@ -599,12 +604,13 @@ btrestrpos(PG_FUNCTION_ARGS)
 
 		if (BTScanPosIsValid(so->markPos))
 		{
-			memcpy(&so->currPos, &so->markPos,
-				   offsetof(BTScanPosData, items[1]) +
-				   so->markPos.lastItem * sizeof(BTScanPosItem));
-			if (so->currTuples)
-				memcpy(so->currTuples, so->markTuples,
-					   so->markPos.nextTupleOffset);
+//			memcpy(&so->currPos, &so->markPos,
+//				   offsetof(BTScanPosData, items[1]) +
+//				   so->markPos.lastItem * sizeof(BTScanPosItem));
+//			if (so->currTuples)
+//				memcpy(so->currTuples, so->markTuples,
+//					   so->markPos.nextTupleOffset);
+			IncrBufferRefCount(so->markPos.buf);			
 		}
 		else
 			BTScanPosInvalidate(so->currPos);
