fixes a bug with unsubscribing