Fixed bug with insert at end of text