         # update subscriptions on device side
         edges = runtime.exportedEdges.concat runtime.edgesForInspection
         return subscribeEdges(runtime, edges).then () ->
-          sendAck connection, { protocol: 'graph', command: command, payload: payload }
+          sendAck connection, request
 
     else if command is "removeoutport"
         delete graph.outports[payload.public]
         sendExportedPorts connection, runtime
-        sendAck connection, { protocol: 'graph', command: command, payload: payload }
+        sendAck connection, request
+        return Promise.resolve()
     else
-        console.log "Unknown FBP runtime command on protocol 'graph':", command, payload
-    return
+        return Promise.reject(new Error("Unknown FBP command graph:#{command} : #{payload}"))
 
 packetSent = (graph, collector, payload) ->
     messages = []

        err.message = "Unexpected error: #{err.message}"
        p = Promise.reject(err)

    if p
        p.catch (err) ->
            payload = { message: err.message }
            connection.send { protocol: contents.protocol, command: 'error', payload: payload }

            console.error('FBP PROTOCOL error:', err)
            console.error(err.stack)

    return null


    connection.send msg

handleGraphCommand = (command, payload, connection, runtime) ->
    request = { protocol: 'graph', command: command, payload: payload }

    graph = runtime.graph
    if command is "clear"
        graph.inports = {}
