Changed fetchFiles() function, using glob instead of scandir now