 
   subscribePubnub: (options = {}, callback) ->
 
+    return @subscribeHelper options, callback  if @authenticated
+
+    @once 'authenticated', => @subscribeHelper options, callback
+
+
+  subscribeHelper: (options = {}, callback) ->
     pubnubChannelName = options.channelName
 
     # return channel if it already exists


      realtimeToken = Cookies.get("realtimeToken")

      @pubnub.auth realtimeToken  if realtimeToken?


  # channel authentication is needed for notification channel and


    {subscribekey, ssl} = KD.config.pubnub
    @timeDiff = 0

    @authenticated = false

    if KD.isPubnubEnabled()
      @pubnub = PUBNUB.init
