add publish-subscribe mode