A federal judge in California on Friday largely granted Facebook’s request to dismiss a shareholder derivative suit targeting the company’s directors over its alleged mishandling of users’ private data, finding that most claims could be dealt with in a similar dispute pending in Delaware Court of Chancery.

U.S. District Judge Haywood Gilliam Jr. of the Northern District of California found that the forum selection provision in the company’s bylaws routing derivative claims to Delaware didn’t deprive plaintiffs suing the company and board members in the wake of Facebook’s Cambridge Analytica scandal of their day in court. The judge, however, gave plaintiffs an opportunity to amend claims they brought under the federal securities laws—claims where the Delaware court would not have jurisdiction.