
186 Ill. App.3d 382 (1989)
542 N.E.2d 509
MARK D. LAND, Plaintiff-Appellant,
v.
ROBERT I. AULER et al., Defendants-Appellees.
No. 4-89-0064.
Illinois Appellate Court  Fourth District.
Opinion filed July 27, 1989.
*383 James W. Yoder and J. Stephen Yoder, both of Yoder Law Firm, of Bloomington, for appellant.
Richard C. Hayden and Paul G. Prendergast, both of Craig & Craig, of Mattoon, for appellees.
Order reversed.
JUSTICE KNECHT delivered the opinion of the court:
This is an appeal from the dismissal with prejudice of an action for legal malpractice based on the retroactive application of O'Connell v. St. Francis Hospital (1986), 112 Ill.2d 273, 492 N.E.2d 1322. We reverse.
The facts of this action are not in dispute: In June of 1980, the plaintiff, Mark D. Land, came in contact with an electric transmission line. The plaintiff subsequently retained Craig H. Greenwood (Greenwood), the original counsel, to represent him in legal action to recover for his resulting injuries.
On June 9, 1982, one day prior to the running of the applicable statute of limitations (Ill. Rev. Stat. 1981, ch. 110, par. 13-202), Greenwood filed the underlying personal injury action in the circuit court of Champaign County. (Land v. Illinois Power Co. (Cir. Ct. Champaign Co.), No. 82-L-652.) Greenwood initiated service of process on the first defendant in June of 1982. In December of 1982 or January of 1983, prior to the completion of service of process in the action, the plaintiff discharged Greenwood. In February of 1983, the plaintiff retained the instant defendant, Robert I. Auler (Auler). Auler completed service of process on the last defendant in June 1983. On August 31, 1983, the circuit court dismissed the personal injury action with prejudice for the failure to obtain timely service of process. 87 Ill.2d R. 103(b).
The plaintiff thereafter filed a legal malpractice action against Greenwood for his failure to obtain timely service of process in the underlying personal injury action. (Land v. Greenwood (Cir. Ct. Champaign Co.), No. 84-L-293.) As an affirmative defense, Greenwood alleged any problems with the service of process in that action could have been corrected at the time of his discharge had the plaintiff exercised the option to voluntarily dismiss the action without prejudice (Ill. Rev. Stat. 1983, ch. 110, par. 2-1009) and to subsequently refile the action within one year (Ill. Rev. Stat. 1983, ch. 110, par. 13-217). The circuit court ruled in favor of Greenwood on the affirmative defense *384 and dismissed the legal malpractice action with prejudice. (Ill. Rev. Stat. 1983, ch. 110, par. 2-619(a)(9).) On May 30, 1985, the appellate court affirmed the dismissal of that action. Land v. Greenwood (1985), 133 Ill. App.3d 537, 478 N.E.2d 1203.
On March 10, 1988, the plaintiff filed the instant legal malpractice action against Auler. The plaintiff contends Auler negligently failed to preserve the underlying personal injury action in not exercising the option of a voluntary nonsuit with subsequent refiling of the action. (Ill. Rev. Stat. 1987, ch. 110, pars. 2-1009, 13-217.) On June 20, 1988, Auler responded with a motion to dismiss the legal malpractice complaint of the plaintiff with prejudice. (Ill. Rev. Stat. 1987, ch. 110, par. 2-619(a)(9).) As an affirmative defense herein, Auler contends the exercise of the nonsuit option was proscribed during his period of legal representation to the plaintiff based on the retroactive application of O'Connell v. St. Francis Hospital (1986), 112 Ill.2d 273, 492 N.E.2d 1322. On December 21, 1988, after argument on the motion, the circuit court dismissed the legal malpractice complaint of the plaintiff with prejudice. The plaintiff now appeals.
The issue on appeal is whether the circuit court erred in dismissing the legal malpractice complaint of the plaintiff with prejudice.
 1 In Illinois, "[a]n attorney is not liable for matters resting within his judgment, notwithstanding that the exercise of that judgment may have occasioned an unfavorable result for the client." (York v. Stiefel (1982), 109 Ill. App.3d 342, 350, 440 N.E.2d 440, 446.) Nor does Illinois law obligate an attorney to guarantee that his judgments and opinions are infallible. (Gruse v. Belline (1985), 138 Ill. App.3d 689, 695, 486 N.E.2d 398, 402-03.) Rather, an attorney may be liable for malpractice only where he fails to exercise a reasonable degree of care and skill in the legal representation of his client. (Smiley v. Manchester Insurance & Indemnity Co. (1978), 71 Ill.2d 306, 313, 375 N.E.2d 118, 122.) Such a factual determination rests with the state of the law during the period of the disputed legal representation. O'Brien v. Noble (1982), 106 Ill. App.3d 126, 130, 435 N.E.2d 554, 557.
 2 In terms of pleading, an action for legal malpractice consists of the following elements: (1) an attorney-client relationship; (2) a duty arising out of that relationship; (3) a breach of that duty; (4) causation; and (5) actual damages. (Cook v. Gould (1982), 109 Ill. App.3d 311, 314, 440 N.E.2d 448, 450.) It is not disputed the cause of action alleged in the instant malpractice pleading is facially proper in form. Absent procedural grounds for attack, dismissal of the pleading rests with the assertion of an affirmative defense. (Ill. Rev. Stat. 1987, ch. 110, par. 2-619(a)(9).) Where an affirmative defense negates the alleged *385 cause of action, the circuit court may properly dismiss the pleading with prejudice. See Szczurek v. City of Park Ridge (1981), 97 Ill. App.3d 649, 655, 422 N.E.2d 907, 911.
 3 During the period of the disputed legal representation, the law in Illinois accorded the plaintiff an absolute right to voluntarily dismiss his action without prejudice (Ill. Rev. Stat. 1983, ch. 110, par. 2-1009) and to subsequently refile the same action within one year (Ill. Rev. Stat. 1983, ch. 110, par. 13-217). (LaBarge, Inc. v. Corn Belt Bank (1981), 101 Ill. App.3d 741, 428 N.E.2d 711.) Given the nature of this right, the plaintiff could refile his action notwithstanding the running of the statute of limitations (Ill. Rev. Stat. 1983, ch. 110, par. 13-217) or the failure to obtain timely service of process (87 Ill.2d R. 103(b)). (See also Aranda v. Hobart Manufacturing Corp. (1977), 66 Ill.2d 616, 363 N.E.2d 796; Franzese v. Trinko (1977), 66 Ill.2d 136, 361 N.E.2d 585.) Accordingly, Auler could have legally exercised the aforementioned nonsuit option (Ill. Rev. Stat. 1983, ch. 110, pars. 2-1009, 13-217) in the underlying personal injury action.
At the time of the instant action, however, Illinois law no longer accorded the plaintiff an absolute right to nonsuit and refile his action. In O'Connell v. St. Francis Hospital (1986), 112 Ill.2d 273, 283, 492 N.E.2d 1322, 1327, the supreme court held the right of the plaintiff to voluntarily dismiss his action (Ill. Rev. Stat. 1983, ch. 110, par. 2-1009) and to subsequently refile the same action within one year (Ill. Rev. Stat. 1983, ch. 110, par. 13-217) should initially be subject to any pending challenge for the failure to obtain timely service of process (87 Ill.2d R. 103(b)). This procedural change in the law, given retroactive application, would arguably undercut the plaintiff's claim of legal malpractice against Auler in the underlying personal injury action.
A retroactive application of O'Connell, though permissible, is not appropriate in the instant action. (See Catlett v. Novak (1987), 116 Ill.2d 63, 506 N.E.2d 586; Muskat v. Sternberg (1988), 122 Ill.2d 41, 521 N.E.2d 932; Martinez v. Erickson (1989), 127 Ill.2d 112, 535 N.E.2d 853.) O'Connell only applies in actions where there is a pending challenge for the failure to obtain timely service of process. (87 Ill.2d R. 103(b).) In the underlying action, however, there was no such challenge (87 Ill.2d R. 103(b)) pending when Auler succeeded Greenwood as counsel in February of 1983. Indeed, a period of several months elapsed until such a challenge (87 Ill.2d R. 103(b)) was filed in that action. In this interim period of time, Auler could have exercised the nonsuit option (Ill. Rev. Stat. 1983, ch. 110, pars. 2-1009, 13-217) to correct any problems with the service of process in the underlying *386 personal injury action.
Given the state of law in Illinois during the period of the disputed legal representation, the affirmative defense asserted by Auler does not negate the cause of action alleged in the instant malpractice pleading. The circuit court therefore erred in dismissing the legal malpractice complaint of the plaintiff with prejudice. Accordingly, we reverse the dismissal order of the circuit court.
Reversed.
LUND and SPITZ, JJ., concur.
