Updated the condition to properly check template name