       callback? err, vm  unless err
 
       handleError err
-      if err
-        return console.warn "Failed to create VM for ", \
-                             {users, groups, hostnameAlias}
-
-      JDomain.ensureDomainSettingsForVM \
-        {account, vm, type, nickname, groupSlug, stack}
-      JDomain.createDomains \
-        {account, domains:hostnameAliases, hostnameAlias, stack}
+
+      return console.warn "Failed to create VM for ", {
+        users, groups, hostnameAlias
+      }  if err
+
+      group = groupSlug
+
+      JDomain.ensureDomainSettingsForVM {
+        account, vm, type, nickname, group, stack
+      }
+
+      JDomain.createDomains {
+        account, domains:hostnameAliases,
+        group, hostnameAlias, stack
+      }
+
       target.addVm vm, handleError
 
   wrapGroup = (group)-> [ { id: group.getId() } ]

                  # Counter created

                  hostnameAliases = JVM.createAliases {
                    nickname:username
                    type:'user', uid, groupSlug:'koding'
                  }

                  JDomain.createDomains {
                    account, stack,
                    domains:hostnameAliases,
                    hostnameAlias:hostnameAliases[0]
                  }


              JDomain.createDomains {
                account, stack,
                domains: hostnameAliases
                hostnameAlias: hostnameAliases[0]
                group: groupSlug
              }

              group.addVm vm, (err)=>
                return callback err  if err
                JDomain.ensureDomainSettingsForVM {
                  account, vm, type, nickname, group: groupSlug, stack
                }
                if type is 'group'
                  @addVmUsers user, vm, group, ->
                    callback null, vm
