fix the bug
generate consistent contig for all and primary contigs