write merge counting fixed