fixed bugs in union_variants