BJ’s Restaurants Inc. (Nasdaq: BJRI) ended its fiscal second quarter better than expected as capacity and other restrictions for restaurants lifted.

The company said it generated total revenue of $290.3 million for the quarter ended June 29, which was up 126.7% from the prior year. Analysts on average expected revenue of $284.3 million.

The chain swung back to profitability in the June quarter recording net income of $6.4 million after a net loss of $29 million in the year-ago period. Analysts expected net income of $4 million.

Get the latest OC business updates for FREE

CEO Greg Trojan, who is set to retire in September, noted the easing of capacity and social distancing restrictions for restaurants in some markets helped the results, particularly in California where BJ’s has 62 locations.

The company, which counts 212 restaurants total, said it expects to open between eight and 10 restaurants in the next fiscal year with a long-term target of 425 doors at minimum.

BJ’s shares were trading down 5% in after-hours trading Thursday to $40 for a market cap of $979.5 million. The company’s shares have climbed about 13% since the start of the year.