new version with template tags that can fail