added fileExists function