fixed if_file issue

details in commits