improved the logging