Bug fix in getFileListSync function