Use thread for OCR