Added pubsub functionality