better error recovery