A massive class action settlement that has ballooned to $30 million for 14,000 Pennsylvania landowners to resolve claims that Chesapeake Energy Corp. wrongly deducted post-production expenses from royalty checks is once again in jeopardy.

According to court documents, Chesapeake has agreed to pay the class $30 million and to amend the leases in question so that landowners could choose how their royalties are calculated and paid. But Chesapeake indicated in conversations with a judge in the U.S. District Court for the Middle District of Pennsylvania that a broader lawsuit filed by the state Attorney General’s (AG) office in 2015 would have to be resolved before it moves forward with the settlement.

Settlement negotiations for the “Demchak case,” referred to by the lead plaintiff, Demchak Partners LP, have occured over the last four years. Chesapeake initially agreed to pay $7.5 million in 2013 and later up to $17 million-plus before settling on the latest figure.

The settlement has consistently been delayed as various parties have stepped forward to represent the class and as its worked its way through court proceedings and struggled against other claims like those brought by the AG’s office. Landowners allege that the producer has unfairly deducted post-production fees from royalties to cover marketing costs, including compression, dehydration and transmission.

In December 2015, former Attorney General Kathleen Kane filed a lawsuit against Chesapeake and some of its subsidiaries, accusing the companies of unfairly deducting post-production costs and asserting that the company violated antitrust claims under the state’s Unfair Trade Practices and Consumer Protection Law.

Anadarko Petroleum Corp. was later added to the lawsuit after the state accused the companies of allocating certain properties for the acquisition of leases that it claims resulted in lower bonus payments and violated the Sherman Act and Federal Trade Commission Act. Anadarko has since left the Appalachian Basin, divesting its assets there in 2016.

The AG’s office and the settlement class have went back and forth over who has standing to bring the claims. According to court documents, the state and Chesapeake still remain at odds over how to settle the AG’s complaint, primarily as it relates to the amount of money that should be paid.

On Dec. 15, however, the Bradford County Court, where the AG’s case is being heard, rejected the companies’ preliminary objections and ruled that the case could go forward, even certifying some issues for appeal to the Commonwealth Court.

Chesapeake has argued in court that its natural gas is in marketable form at the wellhead. The company also has claimed that post-production deductions are allowed under the Pennsylvania Guaranteed Minimum Royalty Act of 1979. That law, which sets forth the minimum payment to landowners with oil and gas leases, does not address marketing costs and how they should be factored into royalty payments. State lawmakers have tried, but failed for years to pass legislation that would clarify the law.

Under the latest settlement, landowners could choose to receive royalties calculated using basis prices or they could take a chance for a higher price by allowing Chesapeake to market the gas and paying for post-production expenses.