fix templates and links