fixing comparision logic in template.