add publish/subscribe functionality