remove any trailing null chars