
809 P.2d 1163 (1991)
119 Idaho 684
Keith D. GILBERT, Petitioner-Appellant,
v.
STATE of Idaho, Respondent.
No. 17955.
Court of Appeals of Idaho.
January 11, 1991.
Petition for Review Denied May 22, 1991.
Alan E. Trimming, Ada County Public Defender, argued, John J. Hansen, Deputy Public Defender, Boise, for petitioner-appellant.
Jim Jones, Atty. Gen. and Michael A. Henderson, Deputy Atty. Gen., argued, Boise, for respondent.
PER CURIAM.
This is an appeal by the petitioner, Keith Gilbert, from an order of the district court dismissing his application under I.C. § 19-4901 for post-conviction relief. The dismissal was based on grounds of res judicata resulting from a habeas corpus action pursued almost simultaneously by Gilbert. The district court also found that the post-conviction proceeding was brought frivolously. We affirm the dismissal of the application but reverse the finding of the district court that the action was brought frivolously.
Gilbert was convicted in Kootenai County of welfare fraud and of evasion of state income taxes. His judgment of conviction was upheld on direct appeal. State v. Gilbert, 112 Idaho 805, 736 P.2d 857 (Ct.App. 1987). After his conviction was affirmed *1164 on appeal, he filed an application for post-conviction relief in Kootenai County, listing eighteen grounds for relief. Most of the grounds pertained to his conviction and sentences; however, two of the grounds concerned the condition of his confinement in the penitentiary in Ada County following sentencing. In particular, Gilbert alleged that he had been subjected to cruel and unusual punishment in the penitentiary by being denied medical treatment and he claimed that he had been denied employment in the penitentiary because of his race, religion or political creed.
The district court in Kootenai County granted the state's motion for summary judgment as to all of Gilbert's grounds for relief except those pertaining to his conditions of confinement in Ada County. As to the latter issues, the district court concluded they should be determined in Ada County as a more appropriate venue than in Kootenai County. See Hays v. State, 113 Idaho 736, 747 P.2d 758 (Ct.App. 1987), aff'd, 115 Idaho 315, 766 P.2d 785 (1988). Upon referral to the Idaho Supreme Court, an order was entered assigning the remainder of Gilbert's application to the district court in Ada County for disposition. I.R.C.P. 40(e).
In the meantime, Gilbert had filed a separate action in Ada County, seeking a writ of habeas corpus. It is not disputed that the petition in that case (H.C. 2980) involved the same confinement issues as were pending in the post-conviction proceeding. Before the post-conviction application was heard by the district court, a magistrate ruled on Gilbert's habeas corpus request. After an evidentiary hearing, the magistrate dismissed the medical treatment claim, finding that Gilbert had failed to show that the state had been deliberately indifferent to his serious medical needs. However, the magistrate found in favor of Gilbert on the other claim, holding that he had been denied employment on the basis of his religion, race or creed. The magistrate further found that the claim regarding medical treatment had been brought frivolously, and entered a partial award of costs and attorney fees to the state for its defense of that claim. Gilbert appealed to the district court. That appeal was pending when the district court in Ada County ultimately decided Gilbert's application for post-conviction relief.
The state moved to dismiss the application for post-conviction relief. In its motion, the state contended that the decision of the magistrate in H.C. 2980 barred Gilbert  under the doctrine of collateral estoppel  from relitigating the same issues in the post-conviction proceeding. The district court agreed and entered an order to that effect, dismissing the application. The court also found that the application had been brought frivolously. Gilbert then filed this appeal.
We note, preliminarily, our standards of review in this case. Whether collateral estoppel or "issue preclusion" bars the relitigation of issues actually adjudicated, and essential to the judgment, in a prior litigation between the same parties is a question of law upon which we exercise free review. Cole v. Kunzler, 115 Idaho 552, 768 P.2d 815 (Ct.App. 1989). With respect to review of the district court's conclusion that Gilbert's application was brought frivolously, we must determine whether the court's conclusion was an abuse of the court's discretion. Werlinger v. State, 117 Idaho 47, 785 P.2d 172 (Ct.App. 1990).
Gilbert raises two challenges to the district court's application of the doctrine of collateral estoppel. First, he contends that, at the time the district court dismissed this case, the decision and order of the magistrate in H.C. 2980 was not a final judgment because it had been appealed and the appeal was then pending. He argues that res judicata requires the existence of a final judgment before precluding relitigation of issues underlying the judgment. Gilbert's position has support in Idaho case law. See Anderson v. City of Pocatello, 112 Idaho 176, 731 P.2d 171 (1987) (listing among the factors for determining whether collateral estoppel applies, the inquiry "Was there a final judgment on the merits?"); Capps v. Wood, 117 Idaho 614, 790 P.2d 395 (Ct.App. 1990) (noting that a judgment which was reversed on appeal resulted *1165 in lack of "final" judgment which would stand as a bar under res judicata to assertion of new claims on remand).
Recently, our Supreme Court noted that it is appropriate to look to relevant sections of RESTATEMENT OF JUDGMENTS (SECOND) (1982) for guidance in deciding questions concerning res judicata. Diamond v. Farmers Group, Inc., 119 Idaho 146, 804 P.2d 319 (1990). The Restatement, at § 13, comment f, takes the position that the pendency of an appeal should not deprive a judgment of res judicata effect. However, it is not necessary to a decision in this case for us to determine whether section 13, comment f, should be adopted. The parties have disclosed to us that, during the pendency of the appeal in this case, Gilbert failed to pursue his appeal of the habeas corpus action in the district court. That appeal was dismissed for failure of Gilbert to file a brief required by the court. Consequently, the magistrate's judgment in the habeas corpus action became final, albeit after the district court had dismissed Gilbert's application for post-conviction relief. Were we to reverse the district court and remand the case due to the lack of a final judgment on the date the court dismissed Gilbert's application, it is obvious that the case once again would be subject to dismissal on grounds of res judicata. We deem such an approach to be inefficient and a waste of judicial resources. As a result, the pragmatic course of action is simply to affirm the district court's application of the doctrine of collateral estoppel in the first instance, nunc pro tunc, because the error  if any  clearly dissipated when the judgment ultimately became final. Viewed in this light, the alleged error was harmless at best. I.C.R. 52.
The second argument posed by Gilbert to demonstrate error by the district court in applying res judicata is premised on the fact that his application for post-conviction relief was filed before the petition for a writ of habeas corpus. He contends that the decision in the habeas corpus action should not bar the post-conviction relief application, because the habeas corpus action was not a "prior" action between the parties. We find this argument disingenuous. The timing of the filing of the actions is not controlling; rather, it is the timing of the adjudication which gives rise to the doctrine of res judicata. See Diamond v. Farmers Group, Inc., supra (complaint filed in Idaho on September 14, 1984; complaint involving same parties and same causes of action filed in Oregon on September 19, 1984; Oregon case went to judgment first; held, judgment in Oregon was res judicata as to the Idaho litigation).
Finally, we address Gilbert's contention that the district court abused its discretion in finding that the application for post-conviction relief was frivolous. At the outset we are at a loss to determine why such a finding was made by the court. There is no determination in the record that any award of fees or costs was made as a result of the court's finding, as is usually the case, and as was done in H.C. 2980. Moreover, since Gilbert did prevail in part in his habeas corpus action, how can it be said that his application for post-conviction relief, filed before the habeas corpus action, did not contain a valid allegation for inquiry? We have noted that:
The determination as to whether a petition is frivolous rests in the trial court's sound discretion... . However, such discretion must be exercised in accordance with applicable legal standards... . We have held that where, as here, questions of law are raised, the non-prevailing party's position is not automatically frivolous simply because the court is unpersuaded. Rather, the test is whether the non-prevailing party's position is plainly fallacious and, therefore, not fairly debatable... . [Citations omitted.]
Werlinger v. State, 117 Idaho 47, 50, 785 P.2d 172, 175 (Ct.App. 1990). Similarly, under the circumstances of this particular case, we cannot say that Gilbert raised a plainly fallacious, and therefore not fairly debatable, issue with regard to discrimination in his employability. In the habeas corpus action, the magistrate determined that in fact Gilbert had established grounds for relief on that claim. We therefore must disagree with the district court's *1166 broad conclusion that Gilbert's application was brought frivolously. We conclude that the record does not support the court's discretionary ruling.
Accordingly, the order of the district court dismissing Gilbert's application for post-conviction relief is affirmed, except insofar as the court determined that the application was brought frivolously. That determination is reversed. No costs or attorney fees allowed on appeal.
