fix error count variable