add hosts from template function