fix checking file exist