           @channels[channel].emit eventName, body
         connect : =>
           @channels[pubnubChannelName] = channelInstance
+          @removeFromForbiddenChannels pubnubChannelName
           callback null, channelInstance
         error   : (err) =>
           @handleError err

  handleError: (err) ->
    {message, payload} = err

    return warn err  unless payload

    {channels} = payload


        KD.utils.sendDataDogEvent "ForbiddenChannel", tags: {channelToken}, sendLogs: no


  removeFromForbiddenChannels: (channelName) ->
    forbiddenChannels = @localStorage.getValue 'ForbiddenChannels'

    return  unless forbiddenChannels[channelName]

    delete forbiddenChannels[channelName]

    @localStorage.setValue 'ForbiddenChannels', forbiddenChannels


  # subscribeBroker subscribes the broker channels when it is enabled.
  # This will be deleted later on
  subscribeBroker: (subscriptionData = {}, callback) ->
