Mildred M. Edwards applied for Social Security retirement insurance benefits in 1978. The Secretary denied her application because she did not have sufficient quarters of coverage to establish eligibility for the benefits. The Secretary relied upon 42 U.S.C. § 411(a)(5)(A) which governs the allocation in community property states of self-employment income from a family business between husbands and wives. That section provides that
[i]f any of the income derived from a trade or business * * * is community income under community property laws applicable to such income, all of the gross income and deductions attributable to such trade or business shall be treated as the gross income and deductions of the husband unless the wife exercises substantially all of the management and control of such trade or business, in which case all of such gross income and deductions shall be treated as the gross income and deductions of the wife[.]
42 U.S.C. § 411(a)(5)(A) (emphasis added). Because the Secretary found that Edwards had not demonstrated that she had exercised substantially all of the management and control of the business, she could not receive credit for her earnings in that business.
On October 20, 1980, Edwards filed this action against the Secretary on behalf of herself and others similarly situated. Edwards challenged the constitutionality of 42 U.S.C. § 411(a)(5)(A) as violative of the Equal Protection Clause of the Fifth Amendment because it unlawfully discriminates against women on the basis of their gender. Three courts had previously held the statute unconstitutional, see Carrasco v. Secretary of HEW, 628 F.2d 624, 630 (1st Cir.1980); Hester v. Harris, 631 F.2d 53, 54 (5th Cir.1980); and Becker v. Harris, 493 F.Supp. 991, 997 (E.D.Cal.1980). The constitutionality of the statute is no longer in issue because the Attorney General has decided not to seek further review in these cases.
After the Secretary notified the district court of the Attorney General’s decision, the Secretary sought to remand Edwards’ individual case. Edwards then filed motions for summary judgment on the issue of liability and for certification of a nationwide class. On May 22, 1981, the district court granted Edwards’ motions and denied the Secretary’s.1 Edwards then asked the district court to determine the new standard for treating self-employment income of a husband-wife business that will replace the unconstitutional standard, rather than leave that determination to the Secretary. The court urged the Secretary to develop a standard and to determine mechanisms for notifying individuals injured by the unconstitutional standard. After the parties were unable to agree on a standard, the court ordered the parties to brief the issues remaining.
The court ordered that the new standard should allow a husband and wife to split the income from the business if they can show that a “co-proprietorship” existed, rejecting the Secretary’s position that a partnership between them must be shown. The court also ordered that the income be split on the basis of the amount of labor each spouse contributed. In addition, the court ordered that the new standard apply retroactively to the beginning of the self-*1499employment program in 1950, with the unlimited right to amend earnings records. In order to assure that this retroactive application not be highly inequitable, the court ordered that no husband lose benefits already calculated to be owing him when some of his income is shifted to his wife’s earnings records, and that each wife be allowed to elect to apply the old standard rather than the new one if that would yield higher benefits. Lastly, the court awarded $29,759 in attorney’s fees. The Secretary appeals the judgment establishing the new standard and the parties cross-appeal the attorney’s fee award.
At oral argument before this court the parties’ positions on some of the issues did not appear to be significantly different. By order dated December 13, 1984, we requested counsel to advise us whether they had come to any agreement as to the issues raised at oral argument. This case was submitted to this panel for decision after the parties informed us that they were unable to agree on the resolution of all of the issues before us. They were able to agree, however, that the partnership-in-fact test proposed by the Secretary2 is the proper standard to replace the unconstitutional standard of 42 U.S.C. § 411(a)(5)(A). Therefore that issue is no longer before us. ANALYSIS
1. Retroactive application of the new standard.
The first issue remaining before us is whether the new standard which replaces 42 U.S.C. § 411(a)(5)(A) should be applied prospectively or retroactively to the beginning of Social Security coverage of self-employed individuals in 1950. In determining whether to apply a decision nonretroactively, we generally consider three factors:
[fjirst, the decision to be applied nonretroactively must establish a new principle of law, either by overruling clear past precedent on which litigants may have relied, * * * or by deciding an issue of first impression whose resolution was not clearly foreshadowed * * *. Second, * * * “we must ... weigh the merits and demerits in each ease by looking to the prior history of the rule in question, its purpose and effect, and whether retrospective operation will further or retard its operation.” * * * Finally, we [weigh] the inequity imposed by retroactive application, for “[w]here a decision 4 * * could produce substantial inequitable results if applied retroactively, there is ample basis in our cases for avoiding the ‘injustice or hardship’ by a holding of nonretroactivity.”
Chevron Oil Co. v. Huson, 404 U.S. 97, 106-07, 92 S.Ct. 349, 355-56, 30 L.Ed.2d 296 (1971) (citations omitted).
We agree with the district court that retroactive application of the new standard is appropriate.3 First, the strong line of gender discrimination cases decided *1500by the Supreme Court in the last decade4 “clearly foreshadowed” the holding that section 411(a)(5)(A) was unconstitutional.
Second, retroactive application will further the purpose of the new partnership-in-fact standard to eliminate the effect of the unconstitutional presumption in favor of the husband and to permit both spouses to participate in the Social Security program by allocating income earned in a family business between them when the requisite intent jointly to operate the business is shown.
Third, a balancing of the equities favors retroactive application. The Secretary initially objected that retroactive application was inequitable.5 She argued that reallocation of income may reduce some males’ quarters of coverage so as to make them ineligible or reduce their benefits, and that some women may be better off with their share of their husbands’ accounts than with their own. The Secretary argued that the danger of upsetting the couples’ retirement plans weighed heavily against retroactivity. Cf. Heckler v. Mathews, 465 U.S. 728, 104 S.Ct. 1387, 1398-1400, 79 L.Ed.2d 646 (1984) (protecting retiring government employees’ reliance interests in unreduced pension benefits an “exceedingly persuasive justification” for Congress’s temporary revival of gender-based eligibility requirements invalidated by Supreme Court in Califano v. Goldfarb, 430 U.S. 199, 97 S.Ct. 1021, 51 L.Ed.2d 270 (1977)).
The district court concluded that retroactivity was still appropriate, however, because it could fashion a remedy to avoid these inequities. The court ordered that, despite recomputation, no current recipient shall have his benefits reduced, and that women who would benefit more from the former system may elect to remain under the original allocation.
The Secretary has withdrawn her objection to retroactive application of the new standard on a case-by-case basis to permit class members who would benefit more from the former system to remain under the original allocation. Thus, those whom retroactive application would harm are protected under the district court’s order.6 She continues to object, however, to that part of the order which requires that a husband’s benefits remain the same even though part of his self-employment income is allocated to his wife and her benefits accordingly increased. The Secretary describes this as a windfall and argues that the court cannot disregard the conditions set by Congress for entitlement to benefits even when doing so might be equitable, Schweiker v. Hansen, 450 U.S. 785, 101 S.Ct. 1468, 67 L.Ed.2d 685 (1981). We agree with the Secretary that this part of the order is improper. The couples should have to choose between reallocating the income to increase the wife’s benefits and maintaining the status quo so that the husband’s benefits remain the same. Otherwise the couples would receive more benefits than the statute provides.
The Secretary next argues that, if the new rule is to apply retroactively, the period of retroactivity should be limited to the period in which the result was “clearly foreshadowed” by previous sex discrimination cases. The Secretary appears to argue that the date of Frontiero v. Richardson, 411 U.S. 677, 93 S.Ct. 1764, 36 L.Ed.2d 583 (1973), would be appropriate. The Secre*1501tary relies upon dicta in Cash v. Califano, 469 F.Supp. 129, 135 (W.D.Va.1979), aff'd, 621 F.2d 626 (4th Cir.1980), and Crumpler v. Califano, 443 F.Supp. 342, 346 (E.D.Va.1978). The parties before those courts, however, first became eligible for benefits and were denied them on the basis of an unconstitutional statute after Frontiero was decided. Cash, 469 F.Supp. at 131; Crumpler, 443 F.Supp. at 346-47.
Whether the unconstitutionality of section 411(a)(5)(A) was “clearly foreshadowed” prior to Frontiero is but one factor. We still must consider the other Chevron Oil factors before limiting the retroactive application of “a decision [establishing] a new principle of law.” United States v. Johnson, 457 U.S. 537, 550, n. 12, 102 S.Ct. 2579, 2587 n. 12, 73 L.Ed.2d 202 (1982) (quoting Chevron Oil, 404 U.S. at 106-07).
In Hurvich v. Califano, 457 F.Supp. 760 (N.D.Cal.1978), the district court ordered retroactive application in a sex discrimination case to 1969, even though the change in the law had not been clearly foreshadowed, because it would be inequitable to deny Hurvich benefits for a period of time on the basis of an unconstitutional gender-based distinction. Id. at 764. We agree with the reasoning expressed in Hurvich. Therefore we conclude that there is no basis for limiting the period of retroactivity to the date of the Frontiero decision.
2. Amendment of Earnings Records
The second issue remaining before us involves the applicability of the statutory time limitations on amending earnings records. Under the Social Security Act, an individual can request an amendment of his or her income records to correct an error or an omission only within three years, three months, and fifteen days from the end of the taxable year. 42 U.S.C. §§ 405(c)(1)(B), 405(c)(4).
The district court held that the Secretary cannot use the statutory time limitations to preclude recomputations where the statute has been found unconstitutional, based on its authority to provide plaintiffs with effective relief. The district court’s order will affect couples whose “net earnings from self-employment” exceeded the maximum amount reportable for the husband as his self-employment income. The order will permit them to enter the excess into the wife’s earnings records, up to the maximum amount reportable to her account. The Secretary argues that this is proper only within the statutory time limits, and that after the time limit has expired, couples may only reallocate the self-employment income already recorded in the earnings records. See 42 U.S.C. § 405(c)(5)(G).
The district court, however, has broad discretion to fashion a remedy which “restore[s] * * * victims of discriminatory conduct to the position they would have occupied in the absence of such conduct.” Milliken v. Bradley, 433 U.S. 267, 280, 97 S.Ct. 2749, 2757, 53 L.Ed.2d 745 (1977) (quoting Milliken v. Bradley, 418 U.S. 717, 746, 94 S.Ct. 3112, 3128, 41 L.Ed.2d 1069 (1974)). Our scope of review is “correspondingly narrow.” Lemon v. Kurtzman, 411 U.S. 192, 200, 93 S.Ct. 1463, 1469, 36 L.Ed.2d 151 (1973). The district court did not abuse its discretion here by allowing amendment of an individual’s earning record after the time limit had expired.
Tax returns filed by the husband will disclose the amount of “net earnings from self-employment” reported pursuant to 26 U.S.C. § 1402(a)(5), the Internal Revenue Code’s version of 42 U.S.C. § 411(a)(5)(A). Those net earnings can be allocated between the husband and wife, up to the maximum amount reportable for each account, under section 405(c)(5)(G). Cf. 42 U.S.C. § 405(c)(5)(F) (earnings record may be amended late to conform to timely filed tax returns); see Hollman v. Dept, of Health & Human Services, 696 F.2d 13 (2d Cir.1982).
We recognize that section 405(c)(5)(G) normally permits only reallocation of self-employment income, not of net earnings from self-employment. We affirm the district court’s order and comply with the spirit rather than the letter of the act to prevent section 411(a)(5)(A)’s unconstitu*1502tional presumption from continuing to taint the earnings records of class members.
3. Award of Attorney’s Fees
The last remaining issues concern whether attorney’s fees were properly awarded by the district court. The district court awarded attorney’s fees to Edwards under 28 U.S.C. § 2412(d)(1)(A).7 That section provides that “a court shall award to a prevailing party * * * fees * * * incurred by that party, in any civil action brought by or against the United States * * *, unless the court finds that the position of the United States was substantially justified * * 28 U.S.C. § 2412(d)(1)(A).
The Secretary appeals this award on two grounds. First, she argues that if this court reverses the district court on the issues raised by this appeal, Edwards will no longer be a “prevailing party” and the award must be reversed. The basis for her argument is that she acquiesced in the unconstitutionality of section 411(a)(5)(A) before Edwards’ complaint was filed, and therefore the only issues on which Edwards prevailed were the relief issues now being appealed.
Second, the Secretary challenges the award on the ground that her position was substantially justified. She relies primarily on succeeding on appeal to show the reasonableness of her position, although she also argues that her position was reasonable even if it does not succeed on appeal.
Because we agree with the Secretary that her position was substantially justified, we find it unnecessary to determine whether Edwards remains the prevailing party on appeal.
“The test of whether or not a Government action is substantially justified is essentially one of reasonableness. Where the Government can show that its case had a reasonable basis both in law and fact, no award will be made.” H.R.Rep. No. 1418, 96th Cong., 2d Sess. 10, reprinted in 1980 U.S.Code Cong. & Ad.News 4953, 4984, 4989. See United States v. 101.80 Acres of Land, More or Less, in Idaho County, Idaho, 716 F.2d 714, 728 (9th Cir.1983) (quoting Hoang Ha v. Schweiker, 707 F.2d 1104, 1106 (9th Cir.1983)).
In reviewing a district court’s decision to award attorney’s fees, we ordinarily will reverse only if the district court abused its discretion. See Rawlings v. Heckler, 725 F.2d 1192, 1194 (9th Cir.1984) (citing Hoang Ha, 707 F.2d at 1105). Because we reversed the district court on one issue and because the parties settled one of the main issues in this case, we consider de novo whether the Secretary’s position was substantially justified. Because all of the issues in this case are legal issues, we need only address whether the government's case had a reasonable basis in law.
Edwards argues that the Secretary has failed to show her position was substantially justified. She characterizes the Secretary’s position as unreasonable because it required the repeated filing of similar actions to force the government to comply with prior court rulings. This argument does not prove that the Secretary acted unreasonably in this litigation, however, because the Secretary acquiesced in the unconstitutionality of section 411(a)(5)(A) prior to the filing of this lawsuit. Nor has the Secretary’s position on the proper standard to replace the unconstitutional statute proven to be unreasonable; her partnership-in-fact test, rather than the co-proprietorship test, was ultimately accepted by Edwards. Her position was also reasonable on the retroactivity issue because the inequities which could be caused by retroactive application are substantial. Moreover, the Secretary succeeded in her efforts to have part of the district court’s order relating to retroactivity reversed. Thus, the Secretary either prevailed on the issues before us or had a reasonable basis in law for her arguments. An award of attorney’s fees is therefore not warranted under section 2412(d)(1)(A).
*1503Edwards appeals the district court’s denial of an attorney’s fee award under 28 U.S.C. § 2412(b).8 Section 2412(b) provides that “a court may award reasonable fees and expenses of attorneys * * * to the prevailing party in any civil action brought by or against the United States” and that “[t]he United States shall be liable for such fees and expenses to the same extent that any other party would be liable under the common law.” 28 U.S.C. § 2412(b). Thus, the United States may be liable for fees under the “bad faith,” “common fund” and “common benefit” exceptions to the American rule. H.R.Rep. No. 1418, 96th Cong., 2d Sess. 9, reprinted in 1980 U.S.Code Cong. & Ad.News 4953, 4984, 4987.
The district court found that an attorney’s fee award was inappropriate under section 2412(b) because there was no showing of bad faith on the part of the Secretary and the plaintiff did not qualify for the common fund/common benefit exception in the statute. Edwards challenges the district court’s finding that the standards of the common benefit doctrine were not met. She contends that the district court applied the requirements of the doctrine too restrictively, and under the proper interpretation an award is proper.
The criteria for an award of fees under the common benefit theory are that the “litigant confers a substantial benefit on an easily identifiable class of persons, where the benefits can be traced with reasonable accuracy, and the costs of litigation can be shifted with some exactitude, to those benefiting.” Cantwell v. County of San Mateo, 631 F.2d 631, 639 (9th Cir.1980) (quoting Stevens v. Municipal Court, 603 F.2d 111, 112 (9th Cir.1979)), cert. denied, 450 U.S. 998, 101 S.Ct. 1703, 68 L.Ed.2d 199 (1981).
In this case the class of persons benefit-ted is not easily identifiable because it includes all who will benefit in the future from the new standard established in this case. The benefit will be difficult to trace with reasonable accuracy because each class member will receive a different amount depending upon his or her circumstances. Lastly, the costs cannot be shifted with exactitude because of the difficulty of identifying the class members and the amount of their benefit. Therefore, we affirm the district court’s order denying attorney’s fees under section 2412(b). CONCLUSION
We affirm the district court’s determination that the new standard, the partnership-in-fact standard agreed upon by the parties,9 should be applied retroactively, but we reverse that part of the order that requires a husband’s benefits to remain unchanged while part of his self-employment income is allocated to his wife and her benefits accordingly increased. We affirm as well the district court’s order that class members should be permitted to amend their earnings records beyond the statutory time limit contained in 42 U.S.C. § 405(e)(1)(B). Otherwise section 411(a)(5)(A)’s unconstitutional presumption will continue to operate to their detriment.
As to the attorney’s fees issues, we affirm the district court’s denial of an award of attorney’s fees under 28 U.S.C. § 2412(b) because plaintiffs fail to qualify for application of the common benefit doctrine. We reverse the award of fees under 28 U.S.C. § 2412(d) because we conclude that the Secretary’s position was substantially justified.
Affirmed in part; reversed in part.
. The district court certified a class of all applicants for or recipients of Old Age, Survivors and Disability Insurance Benefits, 42 U.S.C. § 401 et seq., on their own accounts as wage earners whose applications have been denied or for whom the monthly benefit has been reduced due to the omission from their earnings records of income earned while married and operating a trade or business in a community property state, as required by 42 U.S.C. § 411(a)(5)(A). The class was limited to members who received a final decision from the Secretary of Health and Human Services within 60 days of the filing of the district court action.
. At oral argument, the main controversy regarding the standard to replace 42 U.S.C. § 411(a)(5)(A) involved the nature of the agreement necessary to establish a partnership. The parties now agree to the following statement of the intent to form a partnership for Social Security purposes:
The requisite intent is to jointly operate a business. While in most cases there is a conscious intent to form a partnership, such intent is not essential. When the partners are husband and wife, siblings, parent and child, or otherwise closely related, it may be found that they never saw the need to formally establish a second relationship.
Social Security Administration, Programs Operations Manual System, RS 01802.318 (Oct. 1984). An analysis of the elements of husband and wife partnerships is also contained in Social Security Ruling 84-11 (Apr. 1984).
. The district court had concluded in the alternative that prospective application under Chevron Oil was inappropriate because Chevron Oil considers the retroactive effect of a separate decision, rather than the scope of relief to be afforded in the case before the court, Shannon v. United States Civil Service Commission, 444 F.Supp. 354, 369 (N.D.Cal.1977), modified on other grounds, 621 F.2d 1030 (9th Cir.1980). The Secretary challenges this alternative ground. We agree with the Secretary that the unconstitutionality of § 411(a)(5)(A) was established when the Attorney General decided not to appeal Becker, almost one month before this case was filed, and therefore the Chevron Oil test of retroactivity should be applied.
. See, e.g., Califano v. Westcott, 443 U.S. 76, 99 S.Ct. 2655, 61 L.Ed.2d 382 (1979); Califano v. Goldfarb, 430 U.S. 199, 97 S.Ct. 1021, 51 L.Ed.2d 270 (1977); Califano v. Webster, 430 U.S. 313, 97 S.Ct. 1192, 51 L.Ed.2d 360 (1977); Craig v. Boren, 429 U.S. 190, 97 S.Ct. 451, 50 L.Ed.2d 397 (1976); Weinberger v. Wiesenfeld, 420 U.S. 636, 95 S.Ct. 1225, 43 L.Ed.2d 514 (1975); Frontiero v. Richardson, 411 U.S. 677, 93 S.Ct. 1764, 36 L.Ed.2d 583 (1973); Reed v. Reed, 404 U.S. 71, 92 S.Ct. 251, 30 L.Ed.2d 225 (1971).
. The Secretary does not object to retroactive application of the new standard because it would be costly to the government. Nor does she object to the district court's order because the administrative burden on the agency is great.
. The right to elect to remain under the original allocation will not apply to those who file for benefits after the Secretary stopped applying section 411(a)(5)(A).
. This section was repealed effective October 1, 1984, but continues to apply through final disposition of any action commenced before the date of repeal. Pub.L. 96-481 § 204(c).
. Edwards presses for attorney’s fees under this section because there is no substantial justification exception to defeat an award, and because there is no "cap” on the hourly rate which can be awarded, cf. 28 U.S.C. § 2412(d).
. See note 2.