add error count to finish for debug
errorcount