changes to read_log function and copy_file function