Added error recovery