replace logging with debug