     lastName  : " "
 
   JUser.createUser userInfo, (err) ->
-    return console.log err if err
+    return callback err if err
     JUser.one username : "bot", (err, user) ->
       user.confirmEmail (err) ->
-        return console.error err if err
+        return callback err if err
         JAccount.update "profile.nickname" : "bot", {$set: type: "registered"}, \
           {multi: no}, (err, account) ->
             return callback err if err


  fetchAllProducts (err, productPlanCodes) ->
    return console.error err if err
    queue = []
    insertPlans = race (i, plan, fin) ->
      {title} = plan  
      JPaymentPlan.one title: title, (err, paymentPlan) ->
        return console.error err if err
        if paymentPlan? 
          console.log "#{plan.title} plan is already added" 
          fin()
        else
          JPaymentPlan.create "koding", plan, (err, newPlan) ->
            return console.error err if err
            console.log "#{plan.title} plan added successfully" 
            quantities = {}
            if plan.title is "Custom Plan" 
              quantities[productPlanCodes["CPU"]] = 1
              quantities[productPlanCodes["RAM"]] = 1
              quantities[productPlanCodes["Disk"]] = 1
              quantities[productPlanCodes["Always On"]] = 1
              quantities[productPlanCodes["VM"]] = 5
              quantities[productPlanCodes["User"]] = 1
              quantities[productPlanCodes["Group"]] = 1
            else
              {count} = plan
              quantities[productPlanCodes["CPU"]] = count
              quantities[productPlanCodes["RAM"]] = count
              quantities[productPlanCodes["Disk"]] = count
              quantities[productPlanCodes["Always On"]] = count
              quantities[productPlanCodes["VM"]] = count * 5
            
            console.log 'quantities', quantities
            newPlan.updateProducts quantities, (err) ->
              return console.error err if err
              console.log "#{plan.title} plan products are added"
              fin()
    , -> callback null

    insertPlans plan for plan in data

      -> importPacks ->
        console.log 'All Packs are added'
        queue.next()
      -> createBot (err) ->
        console.error err  if err
        queue.next()
      -> process.exit(1)
    ]

    daisy queue
    
initProducts()

 