Lab1 exercise 5：error recovery