fixed adding of last text segment