fixing broken method findFileInDirectory