repaired exporting data to log file