Added code for updating groups