-fixed infinite loop when matching a text to find the sentences.