changed the searching of files to run in the read action