added fix_wrong_memberships_count