Changed file exists checking method