diff --git a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
index 4bf3da2..538b0a5 100644
--- a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
+++ b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
@@ -20,19 +20,24 @@
 
 public class CCDriver {
     public static void main(String args[]) throws Exception {
-        CCConfig ccConfig = new CCConfig();
-        CmdLineParser cp = new CmdLineParser(ccConfig);
         try {
-            cp.parseArgument(args);
+            CCConfig ccConfig = new CCConfig();
+            CmdLineParser cp = new CmdLineParser(ccConfig);
+            try {
+                cp.parseArgument(args);
+            } catch (Exception e) {
+                System.err.println(e.getMessage());
+                cp.printUsage(System.err);
+                return;
+            }
+            ClusterControllerService ccService = new ClusterControllerService(ccConfig);
+            ccService.start();
+            while (true) {
+                Thread.sleep(100000);
+            }
         } catch (Exception e) {
-            System.err.println(e.getMessage());
-            cp.printUsage(System.err);
-            return;
-        }
-        ClusterControllerService ccService = new ClusterControllerService(ccConfig);
-        ccService.start();
-        while (true) {
-            Thread.sleep(100000);
+            e.printStackTrace();
+            System.exit(1);
         }
     }
 }
\ No newline at end of file
diff --git a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
index 489f696..422748a 100644
--- a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
+++ b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
@@ -26,34 +26,39 @@
     private static final Logger LOGGER = Logger.getLogger(NCDriver.class.getName());
 
     public static void main(String args[]) throws Exception {
-        NCConfig ncConfig = new NCConfig();
-        CmdLineParser cp = new CmdLineParser(ncConfig);
         try {
-            cp.parseArgument(args);
-        } catch (Exception e) {
-            System.err.println(e.getMessage());
-            cp.printUsage(System.err);
-            return;
-        }
-
-        final NodeControllerService nService = new NodeControllerService(ncConfig);
-        if (LOGGER.isLoggable(Level.INFO)) {
-            LOGGER.severe("Setting uncaught exception handler " + LifeCycleComponentManager.INSTANCE);
-        }
-        Thread.currentThread().setUncaughtExceptionHandler(LifeCycleComponentManager.INSTANCE);
-        nService.start();
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public void run() {
-                try {
-                    nService.stop();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
+            NCConfig ncConfig = new NCConfig();
+            CmdLineParser cp = new CmdLineParser(ncConfig);
+            try {
+                cp.parseArgument(args);
+            } catch (Exception e) {
+                System.err.println(e.getMessage());
+                cp.printUsage(System.err);
+                return;
             }
-        });
-        while (true) {
-            Thread.sleep(10000);
+
+            final NodeControllerService nService = new NodeControllerService(ncConfig);
+            if (LOGGER.isLoggable(Level.INFO)) {
+                LOGGER.severe("Setting uncaught exception handler " + LifeCycleComponentManager.INSTANCE);
+            }
+            Thread.currentThread().setUncaughtExceptionHandler(LifeCycleComponentManager.INSTANCE);
+            nService.start();
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+                @Override
+                public void run() {
+                    try {
+                        nService.stop();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+            while (true) {
+                Thread.sleep(10000);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
         }
     }
 }
\ No newline at end of file
