fix template resolution