   fetchRelativeGroups$: secure (client, options = {}, callback) ->
 
     delegate = client?.connection?.delegate
-    currentGroup = client.context.group
-
-    return callback new Error 'malformed request' unless delegate
+    currentGroup = client?.context?.group
+
+    return callback new Error 'malformed request' unless delegate or currentGroup
 
     [ callback, options ] = [ options, callback ]  unless callback
     options ?= {}
 
-    delegate.fetchRelativeGroups { roles: options?.roles ? null }, (err, groups) ->
+    delegate.fetchRelativeGroups { roles: options.roles }, (err, groups) ->
 
       return callback err  if err
 

    { delegate } = client.connection
    { profile: { nickname } } = delegate

    checkUserPassword delegate, password, (err) =>

      return callback new KodingError err  if err

        @fetchAllParticipatedGroups options, (err, groups) =>
          return next err  if err
          JUser = require './user'
          username = @getAt 'profile.nickname'
          for group in groups
            group.jwtToken = JUser.createJWT { username, groupName : group.slug }
          next null, groups
