added check for valid filenames