finish init group function