implement Pub/Sub mode