check if filenames are valid