Added write to csv block