Correct error handling