Optimized unsubscription by first checking for active subscriptions and only continuing if there is one.