Fix exception if no text is found to append