       counterName : 'guest'
       offset      : 0
     }).next (err, guestId) =>
-      return callback err  if err
+      return callback err  if err?
 
       username = "guest-#{guestId}"
 

            callback null, newToken
        else
          callback new KodingError "Session not found!"
        

  @convert = secure (client, userFormData, callback) ->
    { connection, sessionToken : clientId } = client

  @addToGroup = (account, slug, email, invite, callback)->
    JGroup.one {slug}, (err, group)->
      if err or not group then callback err
      else if invite? and invite.group isnt slug and group.privacy is 'private' and group.slug isnt 'koding'
        group.requestAccessFor account, callback
      else
        group.approveMember account, (err)->
