Client side code for subscription