changed log to csv file