           queue.next()
 
       ->
-        params = { email, client, invitationToken, skipAllowedDomainCheck }
-        verifyEnrollmentEligibility params, (err, invitation_) ->
-          return callback err  if err
-          invitation = invitation_
+        params = {
+          groupName : client.context.group
+          invitationToken, skipAllowedDomainCheck, email
+        }
+
+        JUser.verifyEnrollmentEligibility options, (err, res) ->
+          return callback err  if err
+
+          { isEligible, invitation } = res
+
+          if not isEligible
+            return callback new Error "you can not register to #{client.context.group}"
           queue.next()
 
 


      ->
        groupNames = [client.context.group, 'koding']
        options = { skipAllowedDomainCheck }
        JUser.addToGroups account, groupNames, user.email, invitation, options, (err) ->
          error = err
          queue.next()

  @addToGroup = (account, slug, email, invitation, options, callback) ->

    [options, callback] = [{}, options]  unless callback

    options.email           = email
    options.groupName       = slug
    options.invitationToken = invitation.code  if invitation?.code

    JUser.verifyEnrollmentEligibility options, (err, res) ->
      return callback err  if err
