update write to contigs