 
     resolveOrder @config, target, (list) ->
 
-      async.eachSeries list, (details, callback) ->
-        name = details.name
-        container = docker.getContainer name
-        container.inspect (err, data) ->
-          if not data.State.Running
-            log "Starting container #{name}"
-            container.start callback
-          else
-            log "Container #{name} already running..."
-            callback null
-      , done
-
-
-  stop: (container, done) ->
-    throw new Error("Please supply a container to stop") if not container
-
-    target = @config.containers[container]
-
-    throw new Error("Container #{container} does not exist in decking.json") if not target
-
-    container = docker.getContainer container
-    container.stop done
+      validateContainerPresence list, (err) ->
+        return done err if err
+
+        async.eachSeries list, (details, callback) ->
+          name = details.name
+          container = docker.getContainer name
+          container.inspect (err, data) ->
+            if not data.State.Running
+              log "Starting container #{name}"
+              container.start callback
+            else
+              log "Container #{name} already running..."
+              callback null
+        , done
+
+
+  stop: (cluster, done) ->
+    throw new Error "Please supply a cluster to stop" if not cluster
+
+    target = @config.clusters[cluster]
+
+    throw new Error "Cluster #{cluster} does not exist in decking.json"  if not target
+
+    resolveOrder @config, target, (list) ->
+
+      validateContainerPresence list, (err) ->
+        return done err if err
+
+        async.eachSeries list, (details, callback) ->
+          name = details.name
+          container = docker.getContainer name
+          container.inspect (err, data) ->
+            if data.State.Running
+              log "Stopping container #{name}"
+              container.stop callback
+            else
+              log "Container #{name} is not running..."
+              callback null
+        , done
 
   create: (container, done) ->
     # @TODO use the remote API when it supports -name and -link

          if depLength is 0
            doRun()

  cluster_start: (cluster, done) ->
    throw new Error("Please supply a cluster to start") if not cluster

    target = @config.clusters[cluster]

    throw new Error("Cluster #{cluster} does not exist in decking.json") if not target

    log "Starting cluster #{cluster} with #{target.length} containers"

    # @TODO get this in dependency order
    async.eachSeries target, (container, callback) =>
      @start container, callback
    , done

  cluster_stop: (cluster, done) ->
    throw new Error("Please supply a cluster to stop") if not cluster

    target = @config.clusters[cluster]

    throw new Error("Cluster #{cluster} does not exist in decking.json") if not target

    log "Stopping cluster #{cluster} with #{target.length} containers"

    async.eachSeries target, (container, callback) =>
      @stop container, callback
    , done

  build: (image, done) ->

    throw new Error("Please supply an image name to build") if not image

      @start cluster, done

    stop: (done) ->
      [cluster] = @args
      @stop cluster, done

    status: (done) ->
      child_process.exec "docker ps", (err, stdout, stderr) ->
