new pubsub library and added unsubscribe support