BOSTON — An attorney is defending a proposed settlement between a man and Dunkin’ Donuts shops that could mean $500 for the lead plaintiff, free buttered baked goods for hundreds of other customers and a big payout for law firms that handled the class action case.

Jan Polanik had sued a cluster of franchises of the Canton, Massachusetts-based doughnut and coffeehouse chain, saying he received a butter substitute on his bagels when he requested butter.

The proposed settlement, filed in a state court, must still be approved by a judge. According to The Boston Globe, Polanik could receive $500 while about 1,400 other customers who made similar complaints would get up to three free buttered baked goods. The law firms, meanwhile, could get $90,000 in fees under the proposed settlement.

Thomas Shapiro, the lead attorney for the plaintiffs, said it wasn’t a profitable case for his firm.

“I can tell you we’re losing money on this case,” Shapiro said Wednesday. “It’s not that big a case in financial terms.”

Shapiro said if you added up the hours that went into the case and out-of-pocket expenses it would come out to a lot more than $90,000.

The firm thought twice about even taking the case, he added.

“We felt that the principle involved was important enough and something should be done to correct the practice,” he said.

The parent company of Dunkin’ Donuts has said that most of its Massachusetts locations offer both butter substitutes and the real thing.

Customers requesting free buttered baked goods at the affected stores would not be required to show documentation that they had previously paid for items with a butter substitute, Shapiro said.