Call getFilesInDirectory earlier