Subscription fixes

code fixes for subscriptions