changes to add another clause to the directory/file check