added error counter