for checking the template length