Index: /trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- /trunk/FACT++/src/EventBuilderWrapper.h	(revision 15354)
+++ /trunk/FACT++/src/EventBuilderWrapper.h	(revision 15355)
@@ -758,4 +758,5 @@
         }
 
+        /*
         fFiles.erase(it);
 
@@ -765,4 +766,5 @@
 
         fDimEvents.Update(fNumEvts);
+        */
 
         const bool rc = file->Close(tail);
@@ -771,4 +773,19 @@
             // Error message
         }
+
+        // Note that this is the signal for the fadctrl to change from
+        // WritingData back to Connected. If this is done too early,
+        // a new run might be started before this is closed. This is
+        // faster, but leads to problems with the DRS calibration
+        // if the system is fast enough to start the new run before
+        // this one has really been closed.
+        fFiles.erase(it);
+
+        fLastClosed = file->GetRunId();
+        CloseRun(fLastClosed);
+        UpdateRuns();
+
+        fDimEvents.Update(fNumEvts);
+
 
         ostringstream str;
