close file partitions each time