solved minor bug when saving to csv