Index: trunk/FACT++/scripts/Main.js
===================================================================
--- trunk/FACT++/scripts/Main.js	(revision 15455)
+++ trunk/FACT++/scripts/Main.js	(revision 15466)
@@ -201,4 +201,6 @@
     console.out("   ...waiting for 1s");
     v8.sleep(1000);
+    console.out("   ...checking connection");
+    dim.wait("FAD_CONTROL", "Connected", 3000);
     console.out("");
 }
@@ -261,5 +263,5 @@
         {
             dim.wait("MCP", "TakingData", 15000);
-break;
+            break;
         }
         catch (e)
@@ -295,12 +297,8 @@
             reconnect(list, "configuration");
 
-            /*if (n<2)
-                return false;
-
-                throw e;
-                */
-
             if (n==2)
                 throw e;
+
+            dim.wait("MCP", "Idle", 3000);
         }
     }
@@ -480,4 +478,10 @@
 {
     var state = dim.state("BIAS_CONTROL").name;
+
+    if (state=="Disconnected")
+    {
+        console.out("  Voltage off: bias crate disconnected!");
+        return;
+    }
 
     // check of feedback has to be switched on
@@ -657,4 +661,5 @@
     console.out("");
     console.out("Shutdown procedure seems to be finished...");
+    console.out("  "+new Date().toUTCString());
     console.out("  Telescope at Zd=%.1fdeg Az=%.1fdeg".$(report.obj['Zd'], report.obj['Az']));
     console.out("  Please make sure the park position was reached");
@@ -927,5 +932,5 @@
     }
 
-    if (system_on===false && task!="STARTUP")
+    if (system_on===false && obs[obs].task!="STARTUP")
     {
         v8.sleep(1000);
