check template on save