added check the file exists