fixing bug sending non null terminated strings