         dfd.resolve()
     dfd.promise
 
-  createOrConnectBlock: (link, selectedChannel)->
+  createOrConnectBlock: (link, selectedChannel, blocks)->
     dfd = Q.defer()
-    if link.has('connections')
+    if link.get('block_id')
       $.ajax
         type: "POST"
-        url: "#{sd.API_URL}/channels/#{id}/connections"
+        url: "#{sd.API_URL}/channels/#{selectedChannel.id}/connections"
         data:
           connectable_type: 'Block'
           connectable_id: link.get('block_id')

    dfd = Q.defer()
    blocks = @blocks
    selectedChannel = @selectedChannel
    block = new Block source: link.get('href')
    existingConnections = link.get('connections') or []
    @createOrConnectBlock.then (block) ->
        connections = existingConnections.concat [
          {
            title: selectedChannel.get('title')

    @status.set
      selecting: false
      connecting: false
    @selectedChannel.clear()

  showError: (e) ->
    console.log('error', e, e.stack)
