fixed file exists fn