fix appending string bug