fixed template code