         helpers[k] = v
 
     context.on = (obj) ->
-      for k, v of obj
-        ws_handlers[k] = v
+      for message, action  of obj
+        ws_handlers.push {message,action}
 
     context.connect = ->
       context.socket = io.connect.apply io, arguments

        context.share '__local', context.socket, (data) ->
          context.key = data.key

      for name, h of ws_handlers
        do (name, h) ->
          context.socket.on name, (data) ->
            ctx =
              app: app
              socket: context.socket


            apply_helpers ctx

            action.apply ctx

    $(-> app.run '#/') if app?

