fixing cardinality issues