writing change events to csv file