correct error processing