fix the row counter