implment csv exporting (file saved on separate thread)