strip bad newlines