changed how directories are handled