diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl
index 247b90b78a68c497a3b5c26a2287005637bc0891..2e57564f340c8aedcd14d3079113dee3eb56d0d1 100644
--- a/bin/slubsipbuilderbagit.pl
+++ b/bin/slubsipbuilderbagit.pl
@@ -415,12 +415,13 @@ PATCH
         }
     }
 
-    sub copyFilesToMeta($$$$$){
+    sub copyFilesToMeta($$$$$$){
         my $ppn = $_[0];
         my $noppn = $_[1];
         my $metaPath = $_[2];
         my $rightsFilePath = $_[3];
         my $aRefAddMetaFile = $_[4];
+        my $mods = $_[5];
 
         my @addMetaFile = @{ $aRefAddMetaFile };
 
@@ -449,8 +450,7 @@ PATCH
         }
 
         # mods.xml
-        if (defined $ppn) {
-            my $mods = prepare_mods_section_with_ppn($ppn); # get mods from catalog
+        if ($ppn && $mods) {
             write_file("$metaPath/mods.xml", $mods);
         }