finally got the template working