fixed the logging issue