 
 wss = new WebSocketServer {server:server}
 wss.broadcast = (msg, exclude, scope=null) ->
-  for c in this.clients
-    unless c.authenticated then continue
+  this.clients.forEach (c) ->
+    unless c.authenticated then return
     if c isnt exclude and (scope is null or scope is c.authenticated.scope)
       try
         c.send msg

                sock.send JSON.stringify {type: 'assign', subject: i.challenge, data: [{name: i.user}, true]}
            # notify all users about new authentication and notify new socket about other users
            wss.broadcast JSON.stringify {type: 'login', data: ans.name}
            for s in wss.getClients()
              if s.authenticated and s.authenticated.name isnt ans.name
                sock.send JSON.stringify {type: 'login', data: s.authenticated.name}
    else

            db.modifyChallenge c.id, c.title, c.category, c.points
          else
            db.addChallenge msg.data.ctf, c.title, c.category, c.points
        wss.clients.forEach (s) ->
          if s.authenticated and s.authenticated.scope is msg.data.ctf
            s.send JSON.stringify {type: 'ctfmodification'}
      else console.log msg
