   alreadyMember       = alreadyMember is 'true'
 
   queue = [
-
+    ->
+      { teamAccessCode } = body
+      # if we dont have teamaccesscode just continue
+      return queue.next() if not teamAccessCode
+
+      JTeamInvitation.byCode teamAccessCode, (err, invitation) ->
+        return res.status(400).send err.message
+        return res.status(400).send 'Team Invitation is not found'  if not invitation
+        return res.status(400).send 'Team Invitation is not valid'  if not invitation.isValid()
+        return queue.next()
     ->
       koding.fetchClient clientId, context, (client_) ->
 

        -> createInvitations client, invitees, (err) ->
            console.error 'Err while creating invitations', err  if err
            queue.fin()

      ]

      dash queue, (err) ->

      domains
      # username or email of the user, can be already registered or a new one for creation
      username
      # access code for admin to create a team
      teamAccessCode
    } = body

    token = result.newToken or result.replacementToken
