fixed error counter