fix error statistics