Updated Add and Edit to support groups