remove extraneous newlines from response