added file exist check