delivered the opinion of the court.
The appellee, the Maysville & Big Sandy Railroad Company, was incorporated December 18, 1850.' By an amendment to its charter, approved November 25, 1881, the general, provisions of the act of March. 4, 1850, incorporating the Maysville & Lexington Railroad Company, so far as the same were applicable, were made a part thereof; and the twelfth section of the act, thus applied to it, provides : “ Whenever it shall be “ necessary for the construction of the railroad to inter‘‘sect or cross'any stream of water or watercourse, or “ any road or highway lying in or across the route of “said road, it shall be lawful for the corporation to con- “ struct the said railway across or upon the stream, or to “ cut or cross any such road or highway, and to change the *661“ location thereof during the process of the construction “of said railway; but the corporation shall restore the “ stream or watercourse, or road or highway thus inter- “ sected to its former state, or in a sufficient manner not “ to destroy its usefulness; and shall restore any road at “ a grade not exceeding the heaviest grade upon said “ road existing at the present time.”
In the absence of this statutory requirement the general law would have imposed upon the company the duty of so far restoring a road as to render it fit for travel.
A franchise must be prudently exercised. The right of a railroad to cross a highway does not authorize a material interference with the public travel. If, by reason of excavations and erections and changes in the surface it of necessity temporarily occurs to some extent,, it is the duty of the company to so far restore it to its former condition as not to interfere materially with its usefulness to the public. Tt must be made safe and reasonably convenient for travel. A restoration to its former surface level or elevation is not, of course, required, but to its former passable condition and safe-use by the public. (1 Rorer on Railroads, pp. 289-545; Pierce on Railroads, pp. 244, 245.) In this instance, however, the duty of the company and the measure of it was declared by statute.
The appellant, Greenup county, brought this action in equity, the petition averring in substance that the appellee, being insolvent, had entered upon, taken possession of parts of, and crossed one of its roads (naming it) at different places; had thus converted the same to *662its use, obstructing public travel; was then and had so been using it for over a year; had made no crossings; had, in fact, torn up those made by the proper officer of the county; and had failed and refused to restore the road to the conditions prescribed by its charter, although .the appellant had so demanded.
An issue out of chancery was asked as to damages up to the time of trial, which were put at $5,000, and that the appellee be compelled, by proper orders, to restore, by crossings or otherwise, the former condition of the road to the extent named in its charter. A general demurrer to the petition was sustained, and the action dismissed.
The lower court has not given any reasons therefor in the order of dismissal. It is intimated by counsel that it was of the opinion an equitable action could not be maintained. Whether this was the ground of its action or not, the counsel for the appellee now contend there was an adequate legal remedy, and that, therefore, the action will not lie.
It is true, as a general rule, that where a party has a complete and adequate remedy at law, resort to equity will not be allowed. This, however, is an action to enforce a duty enjoined by law upon the company. It is true a recovery of damages for its non-compliance hitherto is sought, but this is permissible in such an action.
A county is a quasi corporation. It may sue and be sued in many instances. It controls the highways within it for the benefit of the public. When they are established, the use of the land passes from the owner and *663vests in the county for the public use. They are under its control. It may, upon a proper state of case, discontinue one. It is the party in interest, and may, therefore, sue for an injury to one. If it could not do so the public would be remediless, however great the wrong. Unquestionably the county may maintain an action at law for such an injury, and recover damages.
It was held in Christian County Court v. Rankin and Tharp, 2 Duvall, 503, that it could do so for the burning of its court-house, and the right to do so for an injury to a highway was expressly recognized in the case of Lawrence County v. Chattaroi Railroad Company, 81 Ky., 225.
This being so, even if resort could not be had to equity to compel a railroad company to comply with a duty enjoined upon it, and from the non-performance of which the party in interest was constantly being injured, yet it would have been error in ruling upon the general demurrer to dismiss the action. A mistake as to the form of it can not be thus reached. Section 8 of the Civil Code provides: “An error of the plaintiff “ as to the form of action shall be cause, not for the “ abatement or dismissal of it, but merely for a change “ into the proper proceedings by an amendment of the •“ pleadings, and a transfer of the action to the proper ■“ docket.”
If a party mistake his forum, advantage must be taken of it under our practice by a motion to transfer to the proper docket.
If, however, a party may maintain a common law action for damages for an injury to property, we fail *664to see why he can not resort to equity for its protection upon a proper state of , case. If a county may sue in damages for an injury to its highway, why may it not go into equity to prevent it when that injury is constantly recurring, and going to the substance and existence of its right ?
Aside from the admitted insolvency of the appellee, the appellant, if restricted to a legal remedy, must continually resort to suit; and even then no adequate remedy for the public injury, owing to its nature, will be furnished.
This, however, is not all. Here a statutory duty is-enjoined upon the company as to the county’s property. Its charter requires it to do a specific thing. The-county is the interested party; and in our opinion it may resort to equity to compel its performance. It is th¡e proper forum;- and in the same suit it may have-an issue out of chancery as to the damages that may hitherto have accrued by reason of the company’s failure to comply with the law’s demand.
Rorer on Railroads, vol. 1, page 551, says: “A bill “in equity will be maintained against a railroad corporation to compel it to comply with the law, and to raise “or lower its grade, as the case may be, in the crossings of a highway or public street by its road. But. “ such proceeding can only be maintained by the mayor “and aldermen of the city, the selectmen of the town, “ or other proper public functionary, and can not be “ prosecuted by a private individual, though the owner “of the land whereon the crossing is situated.”
The acceptance of its charter by the appellee created *665the duty upon its part to comply with its provisions.. An implied contract thereby arose between it and the appellant that, as to the latter’s property, it would do* so; and the enforcement of this duty properly belongs-to an equitable tribunal. An adequate remedy is not afforded at law.
The averments of the petition are to be taken as true upon demurrer. They state a cause of action.
The judgment is therefore reversed, with directions to overrule the demurrer to the petition, and for further proceedings consistent with this opinion.