fixes connection to template