fixed error when the _text was nil when calling endText