enhance error recovery