Fix truncate string issue