fix bug

fix text length calculation error