added tesseract exception handling