adds unsubscribe logic