changes to add another clause to the directory/file check

All the changes in one.