             when 'installing'   then cb code:404, msg:'app is still installing'
             when 'installed'    then cb null, @routes[slug].port
             when 'stopped'
+                unless doStart
+                    return code: 500, msg: 'wont start'
+
                 @startApp slug, (err) =>
                     if err?
-                        cb code:500, msg:"cannot start app : #{err}"
+                        cb code: 500, msg: "cannot start app : #{err}"
                     else
                         cb null, @routes[slug].port
-            else cb code:500, msg:'incorrect app state'
+            else cb code: 500, msg: 'incorrect app state'
 
     # request home to start a new app
     startApp: (slug, cb) =>

        appName = req.params.name
        req.url = req.url.substring "/public/#{appName}".length
        req.url = "/public#{req.url}"
        @ensureStarted appName, (err, port) =>
            return res.send err.code, err.msg if err?
            @proxy.proxyRequest req, res,
                host: 'localhost'

        buffer = httpProxy.buffer(req)
        appName = req.params.name
        req.url = req.url.substring "/apps/#{appName}".length

        doStart = -1 isnt req.url.indexOf 'socket.io'

        @ensureStarted appName, doStart, (err, port) =>
            return res.send err.code, err.msg if err?
            @proxy.proxyRequest req, res,
                host: 'localhost'
