         manifest = app.getHaibuDescriptor()
         console.info "Request controller for starting #{app.name}..."
 
-        @client.stopApp manifest, (err, res, body) =>
-            # ignore stop errors
-
+        @client.stop app.slug, (err, res, body) =>
             @checkMemory (err) ->
-
                 return callback err if err
 
-                @client.startApp manifest, (err, res, body) =>
-
+                @client.start manifest, (err, res, body) =>
                     err ?= new Error body.error.message unless status2XX res
 
                     if err

        console.info "with manifest : "
        console.info JSON.stringify manifest

        @checkMemory (err) ->
            return callback err if err

            @client.startApp manifest, (err, res, body) =>

                err ?= new Error body.error.message unless status2XX res


    # Setup controller client and proxyClient.
    constructor: ->
        @proxyClient = new HttpClient "http://localhost:9104/"
        @client = new ControllerClient
            token: @getAuthController()
        @memoryManager = new MemoryManager()

    # Get token from token file if in production mode.
    getAuthController: ->
        if process.env.NODE_ENV is 'production'
            try
                token = fs.readFileSync '/etc/cozy/controller.token', 'utf8'
                token = token.split('\n')[0]
                return token
            catch err
                console.log err.message
                console.log err.stack
                return null
        else
            return ""

    checkMemory: (callback) ->
        @memoryManager.isEnoughMemory (err, enoughMemory) =>
