fix file check issue in looping func