Improve fix for log file generated