handled the null terminated string