added template injection