Last quarter, Chipotle Mexican Grill (NYSE:CMG) continued its slow but steady comeback following its late 2015 food safety crisis. The company reported that comp sales growth remained solid in the second quarter (albeit not as strong as the 17.8% surge recorded in Q1). As a result, earnings per share soared 167% year over year, surpassing analysts' expectations.

However, Chipotle stock has plunged more than 30% since hitting a 52-week high in May. The decline was initially set off by worries that Chipotle wasn't recovering as fast as hoped, but the stock really cratered in July due to new food safety scares.

CMG Chart

Chipotle Mexican Grill YTD Stock Performance, data by YCharts.

The lapses identified this month are certainly disappointing, but Chipotle has still made a lot of progress in improving its food safety -- and its financial results. While the company may face a setback to its recovery this quarter, customers are likely to return before long.

Another quarter of steady recovery

Last quarter, comparable restaurant sales rose 8.1% year over year at Chipotle, keeping it on a trajectory to post high single-digit comp sales growth for the full year. Chipotle also continued to add new restaurants at a steady pace. As a result, total revenue jumped 17.1%.

The uptick in sales -- along with more efficient labor scheduling and lower promotional costs -- led to strong margin expansion at Chipotle last quarter. This drove its huge jump in EPS, from $0.87 to $2.32: well ahead of the average analyst estimate of $2.18.

According to management, sales trends have been relatively stable for most of 2017. Customer traffic slowed modestly after Chipotle revealed a payment card security breach in late April, but sales returned to normal within a few weeks. However, the company now faces a much bigger challenge after two food safety incidents that made the news last week: a norovirus outbreak at one Chipotle location and a rodent infestation at another.

The interior of a Chipotle restaurant

Chipotle is facing new food safety concerns. Image source: Chipotle Mexican Grill.

New lapses -- here's how Chipotle is responding

Chipotle's management said on the second-quarter earnings call that the company now has some of the strictest food-safety protocols in the restaurant industry. The new procedures are highly effective, but only if they are followed properly.

The norovirus outbreak was the result of a sick employee coming to work rather than staying home. Chipotle implemented a paid sick leave policy last year to prevent this kind of issue. However, against company policy, some Chipotle managers have been pressuring sick employees to come to work, according to a recent Business Insider report.

Chipotle's leadership has gone back and emphasized to all of its managers that there is a zero-tolerance policy for following its food-safety protocols. Workers who are sick must be sent home. As for the rodent infestation, Chipotle claims that it was a very rare incident.

While Chipotle is sharpening its food-safety focus even further to reassure potential customers, management's main plan for reinvigorating sales is to change the subject. The company has recently begun testing a promising new menu item -- queso -- that could become a critical piece of its turnaround.

Boredom is a major reason Chipotle has lost customers, according to the company's research. The menu hasn't changed much since Chipotle was founded more than two decades ago. This issue started to become visible in early 2015, but its impact was vastly magnified by the food-safety crisis later that year. Queso has been Chipotle's most-requested menu item for years, and it could give lapsed customers a new reason to visit.

If queso proves to be popular in Chipotle's test markets, a broad rollout could begin as soon as September, accompanied by some serious marketing muscle. This could provide the necessary spark to drive the next phase of Chipotle's sales recovery.

This is a long-term game

To some investors, it may seem like Chipotle's woes will never end. However, many other restaurant chains -- including Jack in the Box and Taco Bell -- have recovered from serious food-safety crises. If customers believe that the underlying problems have been fixed, they will likely forgive restaurants for temporary lapses.

Chipotle now has one of the best food-safety programs in the industry. If the company steps up its monitoring of the sick-leave policy to ensure that employees stay home when they need to, it should be able to avoid further illness outbreaks.

Meanwhile, Chipotle will use new menu items to create some positive buzz. It is also committed to enhancing its mobile app and other digital capabilities to improve the customer experience. A permanent loyalty program is in the pipeline as well. In the long run, the problems of the past two years will likely become a mere footnote in the history of Chipotle's rise to success.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.