Fix CPU usage issue
Fix log file encoding issue