fixed bugs in fix_wrong_memberships_count to manager