fixed a problem getting csv data from dir more than once