fix bugs in disable logging/metrics