(Reuters) - The S&P 500 cut earlier losses on Monday to end slightly lower, while the Dow declined for an eighth straight session, as investors assessed how the defeat of President Donald Trump’s first major legislative action would impact the rest of his agenda.

With stocks soaring to record highs after Trump’s election, investors are concerned about the fate of his economic plan, including tax reform and infrastructure spending. Congressional Republicans pulled their healthcare overhaul bill on Friday after failing to gather enough votes.

But some analysts and investors are hopeful the healthcare bill’s failure will pave the way for quicker action on legislation deemed desirable by investors, namely tax reform.

“Tax legislation done right and done quickly is a big stimulant to earnings and the market,” said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia.

“The idea that tax legislation will come much quicker than it would have if the healthcare legislation passed is positive, and I think people are grasping onto that as a reason to hang on and buy more,” Tuz said.

The Dow Jones Industrial Average .DJI fell 45.74 points, or 0.22 percent, to 20,550.98, the S&P 500 .SPX lost 2.39 points, or 0.10 percent, to 2,341.59 and the Nasdaq Composite .IXIC added 11.64 points, or 0.2 percent, to 5,840.37.

The Dow’s eighth straight decline marked its longest such streak in nearly six years.

The benchmark S&P 500 had fallen as much as 0.9 percent initially on Monday and briefly dropped below its 50-day moving average for the first time since just after the Nov. 8 U.S. presidential election.

The S&P 500 has climbed 9.4 percent since Trump’s election, but the rally has stalled recently.

“What we have seen the last three years, every time there’s a drastic down move, the market has been so resilient,” said Jake Dollarhide, chief executive officer of Longbow Asset Management in Tulsa. “It’s just incredible what type of short-term memory this U.S. market has and the buying appetite global investors have for the U.S. market.”

The telecoms sector .SPLRCL fell 0.7 percent while financial shares .SPSY dropped 0.5 percent.

Healthcare .SPXHC climbed 0.4 percent, helped by hospital stocks after the healthcare bill's failure.

In corporate news, Snap Inc SNAP.N shares jumped 4.8 percent after several of the Snapchat owner's IPO underwriters gave it "buy" ratings.

About 6.3 billion shares changed hands in U.S. exchanges, below the 7.1 billion daily average over the last 20 sessions.

Declining issues outnumbered advancing ones on the NYSE by a 1.00-to-1 ratio; on Nasdaq, a 1.29-to-1 ratio favored advancers.

The S&P 500 posted 11 new 52-week highs and 7 new lows; the Nasdaq Composite recorded 62 new highs and 54 new lows.