             callbacks : {}
           }
 
-    ensureGroupPermission =(group, account, roles, callback)->
+    ensureGroupPermission = (group, account, roles, callback) ->
       {JPermissionSet, JGroup} = @bongo.models
       client = {context: group.slug, connection: delegate: account}
       JPermissionSet.checkPermission client, "read activity", group,
-        (err, hasPermission)->
+        (err, hasPermission) ->
           if err then callback err
           else unless hasPermission
             callback {message: 'Access denied!', code: 403}
           else
             JGroup.fetchSecretChannelName group.slug, callback
 
-    joinClientGroupHelper =(messageData, routingKey, socketId)->
+    joinClientGroupHelper = (messageData, routingKey, socketId) ->
       {JAccount, JGroup} = @bongo.models
-      fail = (err)=>
+      fail = (err) =>
         console.error err  if err
         @rejectClient routingKey
-      @authenticate messageData, routingKey, (session)=>
+      @authenticate messageData, routingKey, (session) =>
         unless session then fail()
         else JAccount.one {'profile.nickname': session.username},
-          (err, account)=>
+          (err, account) =>
             if err or not account then fail err
-            else JGroup.one {slug: messageData.group}, (err, group)=>
+            else JGroup.one {slug: messageData.group}, (err, group) =>
               if err or not group then fail err
               else 
-                group.fetchRolesByAccount account, (err, roles)=>
+                group.fetchRolesByAccount account, (err, roles) =>
                   if err or not roles then fail err
                   else
                     ensureGroupPermission.call this, group, account, roles,
-                      (err, secretChannelName)=>
+                      (err, secretChannelName) =>
                         if err or not secretChannelName
                           @rejectClient routingKey
                         else

    delete @clients.byExchange[exchange]
    delete @clients.byRoutingKey[routingKey]

  addClient:(socketId, exchange, routingKey, sendOk=yes)->
    if sendOk
      @bongo.respondToClient routingKey, {
        method    : 'authOk'

                when 'broker.clientDisconnected'
                  @cleanUpAfterDisconnect messageStr

      connection.exchange 'auth', AUTH_EXCHANGE_OPTIONS, (authExchange) =>
        connection.queue  'auth', (authQueue)=>
          authQueue.bind authExchange, ''
          authQueue.on 'queueBindOk', =>
            authQueue.subscribe (message, headers, deliveryInfo) =>
              {routingKey, correlationId} = deliveryInfo
              socketId = correlationId
              messageStr = "#{message.data}"
