add map and union writer