modified pubnub stuff