corrected group membership list loop