handle common errors