make sure we remove the handler only when the consumer exit.