fixed list_files_recursive function