Updated file exists functionality