check file in main and sub templates