added function to get files in a folder with pattern