     (rest...)-> listener.apply ctx, bongo.revive rest
 
   addGlobalListener =(konstructor, event, listener)->
-    @eventBus.staticOn konstructor, event, (rest...)=>
+    @eventBus?.staticOn konstructor, event, (rest...)=>
       revived = @revive rest
       listener.apply konstructor, revived
 
   reviveType:(type, shouldWrap)->
+    console.log "bongo/reviveType"
+
     return @reviveType type[0], yes   if Array.isArray type
     return type                       unless 'string' is typeof type
     revived = @api[type] ?

    @outboundQueue.push message

  sendXhr: (url, method, queue) ->
    xhr = new XMLHttpRequest
    xhr.open method, url
    xhr.setRequestHeader "Content-type", "application/json;charset=UTF-8"

        # console.log method

  reconnectHelper:->
    console.log "bongo/reconnectHelper"
    @mq.ready =>
      console.log "bongo/reconnectHelper/ready"
      @readyState = CONNECTED
      @emit 'ready'
      @authenticateUser()


  connectHelper: (callback) ->
    console.log "bongo/connectHelper"

    @mq.once 'connected', callback  if callback

