added ocr function hooks