also put terminating char in the last of string.