Experiment with use of .exists? instead of .file?