Index: trunk/FACT++/src/Fits.cc
===================================================================
--- trunk/FACT++/src/Fits.cc	(revision 12709)
+++ trunk/FACT++/src/Fits.cc	(revision 12710)
@@ -213,5 +213,13 @@
         }
         fFile->WriteKeyNT("COMMENT", fTableDesc, "");
-        //END COMMENTS UPDATE
+
+        if (fFile->GetNumRows() == 0)
+        {//if new file, then write header keys -> reset fEndMjD used as flag
+            fEndMjD = 0;
+        }
+        else
+        {//file is beingn updated. Prevent from overriding header keys
+            fEndMjD = Time().Mjd();
+        }
         return fFile->GetNumRows()==0 ? WriteHeaderKeys() : true;
     }
