added unsubscribe functions and tests