fix loading of templates