modify addGroupId func