handle tesseract return nil correctly