added increments to error counter in error functions