string parsing bug fix