refactoring, changed to checking file to checking directory