I was too quick with my change, I'll move the call to updateTemplates() outside of the if.