diff --git a/dbpf.h b/dbpf.h
index c50cdfc..44f5a66 100644
--- a/dbpf.h
+++ b/dbpf.h
@@ -376,7 +376,7 @@ namespace dbpf {
 		clst.size = pos;
 		
 		if(clst.size > 0) { 
-			clstContent = bytes(clstContent.begin(), clstContent.begin() + pos);
+			clstContent.resize(clst.size);
 			writeFile(newFile, clstContent);
 			package.entries.push_back(clst);
 		}