Fix deprecation warning

File.exists is deprecated