           resolveDomain domainData, (err)->
             return callback err  if err
 
-            createDomain domainData, delegate, callback
+            createDomain domainData, delegate, group.slug, callback
 
   @createDomains = ({account, domains, hostnameAlias, stack, group})->
 

        as: "owner"
      , (err, rel)->
        if err or not rel
          account.addDomain domainObj, (err)->
            console.log err  if err?

    domains.forEach (domain) ->


        callback new KodingError "CNAME record for #{domain} is not matching with #{baseDomain}", "CNAMEMISMATCH"

  createDomain = (domainData, account, group, callback)->

    domain = new JDomain domainData
    domain.save (err)->
      return callback err  if err

      options = {data:{group}}
      account.addDomain domain, options, (err)->
        return callback err  if err
        callback err, domain

  @createDomain$: secure (client, {domain, stack}, callback)->

