trying to return original string if not matched in template.py