last character string bug fix