update groups edit logic