Adding condition around whether to escape filenames