null terminate only once