modify judge whether template file