
799 P.2d 556 (1990)
TAHOE VILLAGE HOMEOWNERS ASSOCIATION, John Zachau and David Gee, Appellants,
v.
DOUGLAS COUNTY, Respondent.
No. 20528.
Supreme Court of Nevada.
October 25, 1990.
*557 Linda E. Johnson, Carson City, for appellants.
Brent T. Kolvet, Dist. Atty., Robert W. Story, Deputy Dist. Atty., Minden, for respondent.

OPINION
PER CURIAM:
According to allegations in the parties' briefs and documentation contained in the record on appeal, appellants, Tahoe Village Homeowners Association, John Zachau, David Gee, and others (Tahoe), sought to build condominiums on certain properties in Stateline, Nevada. Respondent Douglas County (the County) issued building permits for the properties on May 31, 1973. Certificates of occupancy were issued on October 5 and 6, 1976. In October 1985, Tahoe identified areas in need of repair, and in October 1986, Tahoe hired an engineer to inspect the properties. The engineer detected numerous obvious structural defects in the properties.
On August 10, 1988, Tahoe filed a complaint against the County which it amended on October 26, 1988. The first amended complaint alleged that the County wrongfully issued building permits for the properties despite knowledge of defects, and negligently inspected the properties. The County filed a motion to dismiss on the grounds that Tahoe's complaint failed to state a claim for relief pursuant to NRCP 12(b)(5). Tahoe subsequently filed a motion for leave to amend its complaint to specifically include an action for willful misconduct. The district court granted the County's motion to dismiss. The court did not rule on Tahoe's motion to amend its complaint, but Tahoe concedes that the court impliedly denied the motion to amend when it granted the County's motion to dismiss. Tahoe then filed a motion for rehearing and to amend the district court's order and decision. The court denied the motion. Tahoe then filed this appeal from the district court's order granting the County's motion to dismiss.
Initially, we note that the district court properly treated the County's motion to dismiss as a motion for summary judgment. Accordingly, in reviewing the court's order, we accept Tahoe's allegations as true and will affirm the decision below only if, as a matter of law, the County has established that there is no genuine issue of material fact. See Torres v. Farmers Ins. Exch., 106 Nev. ___, 793 P.2d 839, 842 (1990).
As discussed below, the first cause of action in Tahoe's first amended complaint fails to state a cause of action for willful misconduct. Nevertheless, we hold that the first cause of action in Tahoe's first amended complaint does state a cause of action which may permit Tahoe to go forward. As we stated in Butler v. Bogdanovich, 101 Nev. 449, 451, 705 P.2d 662, 663 (1985), "[i]f the County had knowledge of the defects, the County owed a duty to take action as a result of the discovery of the deficiencies. Immunity will not bar actions based on the public entity's failure to act reasonably after learning of a hazard." In this case, Tahoe has alleged in its first cause of action that the County issued *558 the necessary documentation despite knowledge of defects. Therefore, pursuant to Butler, there exists a genuine issue of fact as to whether the County had knowledge of the defects at the time it inspected; consequently, dismissal of this cause of action was improper.[1]
Upon remand, the district court must determine whether the first cause of action in Tahoe's first amended complaint timely states a claim for relief against the County for failing to act reasonably after learning of the deficiencies. Construction was allegedly completed in this case in 1976. Tahoe avers that the alleged deficiencies were discovered in 1985-86. Tahoe filed its complaint in 1988, approximately two years after it allegedly discovered the defects and approximately twelve years after completion of construction. As noted in our recent decision in Lotter v. Clark County, 106 Nev. ___, 793 P.2d 1320, 1323 (1990), the statutes of repose enacted in 1983 do not apply retroactively to claims such as this because the cause of action accrued prior to the statutes' enactment.[2] The cause of action accrued upon substantial completion of the property in 1976. See id. at ___, 793 P.2d at 1323. Thus, NRS 11.220, the statute of limitations applicable to a claim based upon tortious injury to real property, applies. Id. at ___, 793 P.2d at 1323. The four-year limitations period begins to run at the time the plaintiff learns, or in the exercise of reasonable diligence should have learned, of the harm to the property caused by a construction defect. Oak Grove Inv. v. Bell & Gossett Co., 99 Nev. 616, 621-23, 668 P.2d 1075, 1078-79 (1983). In this case, Tahoe alleges that it discovered the defects in 1986. It filed suit in 1988, approximately two years later  well within the four-year statute of limitations. Accordingly, there exists a genuine issue of material fact as to whether Tahoe's delayed discovery was made in the exercise of reasonable diligence. Id. at 623, 668 P.2d at 1079. Therefore, reversal is warranted, and we remand to the district court for a determination of timeliness.
Next, we hold that the district court correctly concluded that Tahoe's first amended complaint did not establish a material issue of fact regarding willful misconduct.[3] The first cause of action in Tahoe's first amended complaint states that the County inspected during construction, discovered defects, and, despite knowledge of the defects, wrongfully issued the necessary documentation. These allegations are insufficient to allege willful misconduct. Willful misconduct requires some degree of intent to do harm, see Rocky Mt. Produce v. Johnson, 78 Nev. 44, 51, 369 P.2d 198, 201-02 (1962), yet Tahoe's complaint contains no allegations regarding intent. Therefore, the district court properly concluded that Tahoe failed to plead facts to support a cause of action alleging willful misconduct.
Lastly, we hold that it was proper for the district court to grant the County's motion as to the second cause of action. The second cause of action in Tahoe's first amended complaint alleges an action for negligence against the County. NRS 41.033 provides the County immunity from liability in actions based upon failure to inspect or negligent inspections. Although *559 Tahoe's complaint alleges negligence arising from activities in addition to inspection, the basic thrust of the action is for negligent inspection. This second cause of action does not allege that the County had knowledge of the alleged defects and is therefore distinguishable from the Butler type of action discussed above. Consequently, the complaint fails to state a cause of action for negligence because the County is immune from such action.[4] It was therefore properly dismissed.
Accordingly, we reverse the order granting the County's motion to dismiss and remand the case to the district court for a determination of whether Tahoe's delayed discovery was made in the exercise of reasonable diligence; in the event that the court answers that question in the affirmative, then a trial must be held with respect to the first cause of action of Tahoe's first amended complaint.
NOTES
[1]  Although appellant does not raise this issue on appeal, we hold that the district court's failure to recognize a viable cause of action constituted plain error. Reversal is therefore warranted. See Bradley v. Romeo, 102 Nev. 103, 105, 716 P.2d 227, 228 (1986).
[2]  We are not unmindful of the County's contention that in responding to this appeal it relied on our decision in Elley v. Stephens, 104 Nev. 413, 760 P.2d 768 (1988), regarding applicability of the statutes of repose. However, we note that, because neither party in Elley raised the issue addressed in Lotter, the issue was simply not considered. We hold, therefore, that the sound reasoning of Lotter controls.
[3]  In its brief, Tahoe mistakenly relies on its proposed second amended complaint, which specifically included an action for willful misconduct. Tahoe concedes, however, that by granting the County's motion to dismiss, the district court impliedly denied Tahoe's motion to amend its complaint. On appeal, Tahoe does not challenge the district court's denial of its motion to amend its complaint. We, therefore, have relied on Tahoe's first amended complaint in deciding this appeal.
[4]  Because the County failed to claim immunity in the court below, the district court unnecessarily determined that the action was time barred. However, as discussed supra, the action was nevertheless properly dismissed.
