Fix a bug when log file does not exists