validate the template