A California appellate court has nixed the state legislature’s efforts to work around a prior ruling forcing the state to return about $330 million from its general fund to a settlement fund created to help distressed homeowners in the wake of the foreclosure crisis.

The Third District Court of Appeal last year found the legislature had unlawfully redirected funds from California’s dedicated portion of a massive $25 billion federal settlement reached in 2012 with the nation’s five largest mortgage servicers. While the state’s appeal of the Third District’s order to return the funds was pending at the California Supreme Court, the legislature passed a bill last year declaring that its prior actions and those of the state’s finance department ”were made for purposes consistent with the national mortgage settlement.”