     user                  = null
     account               = null
     invitation            = null
+    groupIsBeingCreated   = no
     groupName            ?= 'koding'
 
     queue = [ =>

            return callback err  if err
            return queue.next()
    , ->
      # we are sure that user can access to the group, set group name into
      # cookie while logging in
      session.update { $set : {groupName} }, (err) ->

    , =>
      # check for membership
      JGroup.one { slug: groupName }, (err, group) =>
        if err
          return callback { message: "group doesnt exist"}

        if not group
          groupIsBeingCreated = yes
          return queue.next()

        group.isMember account, (err , isMember)=>
          return callback err  if err
