removing unwanted newlines