Fix bug of error recovering