     return  if Object.keys(items).length < 2
     {domain, machine, rule, extra} = items
 
-    return new KDNotificationView title: "FIXME ~GG"
-
     if domain and machine
-      jDomain = domain.dia.getData().domain # JDomain
-      vmName  = machine.dia.getData().title # JVM.hostnameAlias
-      jDomain.unbindVM hostnameAlias: vmName, (err)=>
+      jDomain   = domain.dia.getData().domain # JDomain
+      machineId = machine.dia.getData()._id   # JMachine._id
+      jDomain.unbindMachine machineId, (err)->
         return KD.showError err  if err
-        jDomain.hostnameAlias.splice jDomain.hostnameAlias.indexOf(vmName), 1
+        jDomain.machines.splice jDomain.machines.indexOf(machineId), 1
         removeConnection()
     else if domain and rule
       removeConnection()

    return  if Object.keys(items).length < 2
    {domain, machine, rule, extra} = items

    return new KDNotificationView title: "FIXME ~GG"

    if extra
      return new KDNotificationView
        title : "Assigning resources will be available soon."

    if domain and machine and not KD.checkFlag 'nostradamus'
      if domain.dia.getData().domain.hostnameAlias.length > 0
        return new KDNotificationView
          title : "A domain name can only be bound to one machine."

    if domain and machine
      jDomain = domain.dia.getData().domain # JDomain
      vmName  = machine.dia.getData().title # JVM.hostnameAlias
      jDomain.bindVM hostnameAlias: vmName, (err)=>
        return  if KD.showError err
        jDomain.hostnameAlias.push vmName
        createConnection()
    else if domain and rule
      createConnection()


    for _mkey, machine of machineDias
      for _dkey, domain of domainDias
        machines = domain.getData().machines
        if machines and machine.getData()._id in machines
          @connect {dia : domain , joint : 'right'}, {dia : machine, joint : 'left' }, yes

    for restriction in EnvironmentRuleContainer.restrictions?
