add until loop to catch wrong filenames