handling unescaped templates