     JGroup.on 'MemberRolesChanged', ({group, member})->
       return  if group.slug 'koding'  # TODO: remove this special case
       member.fetchUser (err, user)->
-        if err then handleError err
-        else
-          member.checkPermission group, 'sudoer', (err, hasPermission)->
-            if err then handleError err
-            else if hasPermission
-              member.fetchVms (err, vms)->
-                if err then handleError err
-                else
-                  vms.forEach (vm)->
-                    vm.update {
-                      $set: users: vm.users.map (userRecord)->
-                        isMatch = userRecord.id.equals user.getId()
-                        return userRecord  unless isMatch
-                        return { id, sudo: hasPermission }
-                    }, handleError
+        return handleError err  if err
+        return handleError new Error "user not found"  unless user
+
+        member.checkPermission group, 'sudoer', (err, hasPermission)->
+          if err then handleError err
+          else if hasPermission
+            member.fetchVms (err, vms)->
+              if err then handleError err
+              else
+                vms.forEach (vm)->
+                  vm.update {
+                    $set: users: vm.users.map (userRecord)->
+                      isMatch = userRecord.id.equals user.getId()
+                      return userRecord  unless isMatch
+                      return { id, sudo: hasPermission }
+                  }, handleError

      return callback err  if err
      account.fetchUser (err, user)=>
        return callback err  if err

        # We are keeping this names just for counter
        planOwner   = "group_#{group._id}"


    JGroup.on 'MemberRemoved', ({group, member})->
      member.fetchUser (err, user)->
        return handleError err  if err
        return handleError new Error "user not found" unless user

        # Do we need to take care guests here? Like when guests ends up session
        # Do we also need to remove their vms? ~ GG
        if group.slug is 'koding'
          member.fetchVms (err, vms)->
            if err then handleError err
            else vms.forEach (vm)->
