Finally made templates work