fixed template injection errors