more changes for autoupdating templates, its basically working now