fix linking templates with triggers