OCR better error handling