       if model
         return error "The domain #{domain} already exists", "DUPLICATEDOMAIN"
 
-      domainData = { domain, group }
-
-      resolveDomain domainData, (err)->
+      resolveDomain domain, (err)->
         return callback err  if err
 
-        createDomain {
-          account: delegate, domainData, group, stack
+          domain, group, stack
+          account: delegate
         }, callback
       , type is 'custom'
 


    domains.forEach (domain) ->

      createDomain {
        domainData: {
          domain, hostnameAlias : [ hostnameAlias ]
        }, account, group, stack
      }, (err, domain)->

        if err? then console.error err  unless err.code is 11000


  createDomain = (options, callback)->

    { domain, account, group, stack, hostnameAlias } = options

    domainData = { proposedDomain: domain, group }

    JStack = require './stack'
    JStack.getStack account, stack, (err, stack)=>
