adding file exist check for #3