adding templateIds to groups.