improved the logging for the script