Add PubSub and callback functions