dir handling fixed