fix file exist check