Fix read_log function