implement better OCR handling