         node: edge.to.node
         port: edge.to.port
       metadata: edge.metadata
-      graph: @graph.properties.id
+      graph: @graphId
 
   removeEdge: (edge) =>
     @registerChange 'removeedge',

    while @changes.length
      change = @changes.shift()
      @runtime.sendGraph change.topic, change.payload
    @outPorts.sent.beginGroup @graph.properties.id if @graph
    @outPorts.sent.send true
    @outPorts.sent.endGroup() if @graph
    @outPorts.queued.send @changes.length

      id: node.id
      component: node.component
      metadata: node.metadata
      graph: @graphId

  removeNode: (node) =>
    @registerChange 'removenode',
      id: node.id
      graph: @graphId

  renameNode: (from, to) =>
    @registerChange 'renamenode',
      from: from
      to: to
      graph: @graphId

  changeNode: (node) =>
    key = 'changenode- ' + node.id
    metadata =
      id: node.id
      metadata: node.metadata
      graph: @graphId
    if @changesStates[key] is undefined
      @changesStates[key] = @registerChange 'changenode', metadata
    else
