         type, uid, groupSlug
       }
 
-      JVM.createDomains hostnameAliases
+      JVM.createDomains hostnameAliases, hostnameAliases[0]
 
       vm = new JVM {
         users         : [


  {permit} = require './group/permissionset'
  {secure} = require 'bongo'

  KodingError = require '../error'


          regYears      : 0
        ).save (err)-> console.log err  if err?

  @ensureDomainSettings = ({vm, type, nickname, groupSlug})->
    domain = 'kd.io'
    if type is 'user'
      requiredDomains = ["#{nickname}.#{groupSlug}.#{domain}"]
      if groupSlug is 'koding'
        requiredDomains.push "#{nickname}.#{domain}"
    else
      requiredDomains = ["#{groupSlug}.#{domain}", "shared.#{groupSlug}.#{domain}"]
    @createDomains requiredDomains, vm.hostnameAlias

  @createAliases = ({nickname, type, uid, groupSlug})->
    domain       = 'kd.io'
    aliases      = []
    if type is 'user'
      if uid is 0
        aliases.push "#{nickname}.#{groupSlug}.#{domain}"
