diff --git a/perl/exit_strategy.pl b/perl/exit_strategy.pl
index 014a7e5f1c0cf27aaf7e99da12e7822ab58f5dc6..ec5d2fa92af85f2895aa71bde328c01ca6aba534 100644
--- a/perl/exit_strategy.pl
+++ b/perl/exit_strategy.pl
@@ -255,7 +255,8 @@ SQL_DELETE_PLAN
 #     $ret{"dcrecords"} = \@dcrecords;
 ###############################################################################
 {
-  my $lza_id_counter = 0;
+  my $lza_id_counter=0;
+  my %lza_id_counter_hash;
   sub write_addsql($dbh, $plans, $refhash) {
     my $iefile = basename($refhash->{"filename"});
     my ($ieid, $ieversion);
@@ -273,8 +274,13 @@ SQL_DELETE_PLAN
     } @{$refhash->{"dcrecords"}};
     my $lza_id = @{$lza_id_kv}[1];
     if (!defined $lza_id) {
-      $lza_id = sprintf("SLUB:LZA:migration_from_rosetta:unknown_%05lu", $lza_id_counter++);
-      warn ("no lza id detected on $refhash->{filename}, using $lza_id now!");
+      if (!exists( $lza_id_counter_hash{ $ieid} )) {
+        $lza_id = sprintf("SLUB:LZA:migration_from_rosetta:unknown_%05lu", $lza_id_counter++);
+        warn("no lza id detected on $refhash->{filename}, using $lza_id now!");
+        $lza_id_counter_hash{ $ieid} = $lza_id;
+      } else {
+        $lza_id = $lza_id_counter_hash{ $ieid};
+      }
     }
     # start SQL insert
     eval {$plans->{aip}->execute($ieid, $lza_id, $ieversion)} or die "sql problem detected with $ieid ($ieversion), plz check if there is a dublette dir, ", $dbh->errstr;