Coffee giant Starbucks has bolstered its loyalty program and maintained steady same-store sales growth, but it still hasn't been able to grow at a fast enough pace to placate investors.

Shares of the company slipped nearly 3 percent in aftermarket trading Thursday.

In the quarter ended April 1, the company said that net income in the second quarter rose to $660.1 million, or 47 cents per share, from $652.8 million, or 45 cents per share.

Excluding items, the company earned 53 cents per share, in-line with analyst expectations, according to Thomson Reuters.

The company's revenue grew 14 percent to $6.03 billion, better than the $5.9 billion analysts had expected.

Here's how the company performed:

Adjusted earnings: 53 cents per share, in-line with estimates, according to Thomson Reuters

Revenue: $6.03 billion vs. estimates of $5.9 billion, according to Thomson Reuters

Same-store sales: 2 percent growth in the U.S. vs. 1.8 percent growth expected, according to StreetAccount

Same-store sales in the U.S. grew 2 percent in the quarter, higher than the 1.8 percent analysts had expected, according to Street Account. Traffic, however was flat, according to COO Rosalind Brewer.

Starbucks has struggled with sales in the U.S. for several quarters, as new beverage concoctions continued to fall flat with consumers and in-store merchandise remained on shelves unsold.

"Importantly, we saw comps accelerate in both the U.S. and China throughout the quarter, giving us confidence in both our full year and long-term guidance," CEO Kevin Johnson said.

Global same-store sales also outpaced expectations, rising 2 percent, buoyed by a 3 percent increase in average ticket. Analysts had expected global same-store sales to rise 1.8 percent.

During the quarter, Starbucks added 1.6 million members to its loyalty program in the U.S., up 12 percent from a year ago. These customers accounted for 39 percent of sales at company-owned stores in the U.S., according to Starbucks.

Starbucks loyalty program is merged with its mobile app, although customers can opt to just use the app just for mobile payments. Growing the number of people who use this service is key for the coffee chain.

"Establishing digital relationships with many more customers represents a significant growth opportunity, as we have proven that a direct communication channel combined with personalization enhances the customer experience and drives increased engagement," Johnson said during the call.

The coffee giant has been working on a number of initiatives to turn around these weak sales, including offering more cold beverages, which are now 50 percent of its business, and new lunch items to draw people into its cafes in the afternoon.

The company reiterated its 2018 outlook, but did not state how much of an impact closures of company-owned stores in the U.S. on the afternoon of May 29 will have on the company. The event will likely result in a multimillion dollar hit from lost sales.

An incident in Philadelphia, in which two black men were arrested for trespassing after asking to use a Starbucks bathroom, went viral, when the arrest video was posted online, sparking protests and calls for boycotts.

Starbucks management responded swiftly, meeting city officials and the men who were involved. It is unclear, however if this incident has hurt sales in the last few weeks.

"Our leadership team has been on the ground to understand all aspects of this incident," Johnson said. "I am personally committed to about on several fronts to insure it never happens again."

The coffee chain continues to expect that it will open 2,300 net new Starbucks stores globally and will see global same-store sales growth of between 3 and 5 percent for the year.

The company also said that its board had authorized $100 million repurchase of shares.

Correction: A previous version of this story incorrectly said that Starbucks' earnings topped analyst expectations.