fixing embedded nul in string issue