Added some group adding logic.