fixed counting of errors on retry