fixed fix_wrong_memberships_count