fixed bug where csv files could contain duplicates