fix a bug in get_filenames()

datadir was not being passed properly to the file finder function