Fixed pubsub implementation