add pubsub method