fix cannot highlight text with only one word in the first line
check position nullity in getTextFromBoxes