improved the find_files function to be able to exclude directories from the search