The U.S. stock market set another round of record highs on Friday as Wall Street looked past disappointing results from major companies to wrap up its best month of the year.

The S&P 500 rose 0.19% to close at 4,605.38 and the Dow Jones Industrial Average added 89.08 points, or 0.25%, to finish at 35,819.56. The Nasdaq Composite rose 0.33% to close at 15,498.39. All three closed at record highs, and the S&P 500 and Nasdaq clinched their best months since November 2020.

The positive performance came despite weak third-quarter reports from two of the market’s biggest companies.

Amazon shares dropped 2.1% after the e-commerce giant badly missed earnings and revenue expectations for the third quarter. Apple stock fell 1.8% after the tech giant’s quarterly revenue fell short of expectations amid larger-than-expected supply constraints on iPhones, iPads and Macs. It was the first time Apple’s revenues have missed Wall Street estimates since May 2017.

However, Microsoft rose 2.2% to surpass Apple as largest listed company in the world by market cap. Nike and Intel also had solid days to boost the Dow.

Despite the disappointing results from Big Tech, the stock market has been raking in records amid solid earnings even with global supply chain concerns. About half of the S&P 500 have reported quarterly results and more than 80% of them beat earnings estimates from Wall Street analysts. S&P 500 companies are expected to grow profit by 38.6% year over year.

“So far, I think it is fair to say that companies have managed to navigate these headwinds effectively, of course having the benefit of strong demand,” said Angelo Kourkafas, an investment strategist at Edward Jones. “But they are not immune to it. These input cost pressures will show up as reduced revenue or potentially lower profit margins.”

“But I think so far, with about half to the S&P 500 companies having reported, the initial assessment is that profitability has remained fairly resilient because of strong demand and pricing power,” he added.

Shares of Exxon Mobil and Chevron rose on Friday after the energy giants topped earnings expectations. Starbucks, however, was under pressure after revenue from China missed expectations.

All three major averages posted their fourth positive week in a row and finished solidly higher for the month. The Nasdaq gained 7.2% for October, while the S&P 500 gained 6.9%. The Dow rose 5.8% for its best month since March. The month marked a rebound from September, where the major indexes declined.

Market sentiment was also helped by developments in Washington. On Thursday, President Joe Biden announced a framework for a $1.75 trillion social spending deal. The agreement, which is expected to make it easier to pass the separate infrastructure spending bill currently stalled on Capitol Hill, came in lighter on spending and taxes than earlier proposals.

Yung-Yu Ma, chief investment strategist at BMO Wealth Management, said the deal appeared to be in a “sweet spot” and should create more optimism among investors.

“The tax portion of it is looking like it’s going to come in probably below all of the original expectations. So the burden for specifically corporate taxes is going to be lower than the concerns and the expectations in the marketplace were,” Ma said.

Treasury Secretary Janet Yellen spoke to CNBC on Friday morning, saying she was hopeful that the administration’s infrastructure package would be approved soon while saying she does not believe it will add to the inflation problems the U.S. has been experiencing.

“It will boost the economy’s potential to grow, the economy’s supply potential, which tends to push inflation down, not up,” Yellen said during a live “Worldwide Exchange” interview.