
3 Cal.App.4th 512 (1992)
4 Cal. Rptr.2d 347
JOHN E. PARKER, Plaintiff and Appellant,
v.
ROBERT E. McKEE, INC., Defendant and Respondent.
Docket No. B055143.
Court of Appeals of California, Second District, Division Five.
February 7, 1992.
*513 COUNSEL
Schimmenti, Mullins & Berberian and John J. Schimmenti for Plaintiff and Appellant.
Dickson, Carlson & Campillo, Hall R. Marston and Jean A. Hobart for Defendant and Respondent.
OPINION
ASHBY, J.
In this personal injury action plaintiff and appellant John E. Parker appeals following the sustaining of a demurrer, without leave to *514 amend, to appellant's amended complaint against defendant and respondent Robert E. McKee, Inc. (1) (See fn. 1.) The basis of respondent's demurrer was that appellant's amended complaint improperly invoked the Doe defendant procedure of Code of Civil Procedure section 474 to avoid the statute of limitations.[1]
We reverse. (2) Although appellant knew respondent's identity when appellant filed the original complaint, appellant has alleged he was ignorant of respondent's legal capacity (as the general contractor on the construction project where appellant was injured). While still ignorant of respondent's legal capacity in connection with the accident, appellant named but then mistakenly dismissed respondent from the suit. We hold in these circumstances appellant is not precluded from using the Doe defendant procedure to bring respondent back into the suit after the statute of limitations has run.
Appellant was a security guard at TRW in Redondo Beach. On November 13, 1987, while the TRW building was being remodeled, appellant was injured in a fall from stairs.
On May 6, 1988, appellant timely filed a Judicial Council form complaint for general negligence and premises liability. The complaint alleged that certain named defendants, and Does 1 to 10 inclusive, negligently caused damage to appellant in that "[d]efendants negligently allowed debris to accumulate on a stairs which was negligently built without an adequate guardrail, causing plaintiff to fall."
The named defendants in the original complaint were "Murry & Co., Robert E. McKee, Inc. [respondent], Southland Heating, Alrite Insulation, M. Foley." (Italics added.)
On June 5, 1989, however, appellant filed a voluntary request for dismissal as to respondent. The dismissal was entered the same day. Allegedly *515 the reason appellant dismissed respondent from the suit was inability to locate respondent for service of process.
On September 4, 1990, appellant filed a form amendment under Code of Civil Procedure section 474, alleging "[u]pon filing the complaint herein, plaintiff being ignorant of the true name of a defendant, and having designated said defendant in the complaint by a fictitious name, to-wit: DOE I, and having discovered the true name of said defendant to be ROBERT McKEE hereby amends his complaint by inserting such true name in the place and stead of such fictitious name wherever it appears in said complaint."
Respondent Robert E. McKee, Inc., demurred to the amended complaint. Respondent contended the amended complaint was barred by the one-year statute of limitations (Code Civ. Proc., § 340, subd. (3)) and that use of Code of Civil Procedure section 474 was improper because the original complaint showed on its face that at the time of filing the complaint appellant was not ignorant of respondent's name.
In opposition, appellant's counsel submitted a declaration that at the time of filing the original complaint appellant and his counsel knew only that Robert E. McKee, Inc., was one of the contractors involved in the project. They discovered for the first time on July 20, 1990, that respondent was the general contractor on the project. They discovered this at an arbitration hearing where a subcontractor cross-complained against respondent. Appellant contended his initial ignorance of respondent's status as general contractor constituted ignorance of facts giving him a cause of action against respondent, and the belated discovery entitled appellant to use the Doe procedure to bring respondent back into the suit after the statute of limitations had run. Respondent contended its status as general contractor did not change the nature of its liability, therefore appellant had not shown that at the time of filing the original complaint appellant was ignorant of facts giving rise to a cause of action against respondent.
The trial court sustained respondent's demurrer without leave to amend.[2]

DISCUSSION
Code of Civil Procedure section 474 provides in pertinent part, "When the plaintiff is ignorant of the name of a defendant, he must state that fact in the *516 complaint, ... and such defendant may be designated in any pleading or proceeding by any name, and when his true name is discovered, the pleading or proceeding must be amended accordingly."
Although the statute refers literally only to ignorance of the name of a defendant, it is well established that amendment is permitted, even though the plaintiff knew a defendant's name, if plaintiff was ignorant of the facts giving rise to a cause of action against that defendant. (Mishalow v. Horwald (1964) 231 Cal. App.2d 517, 521-522 [41 Cal. Rptr. 895]; Wallis v. Southern Pac. Transportation Co. (1976) 61 Cal. App.3d 782, 786 [132 Cal. Rptr. 631].) If the amended pleading involves the same general set of facts, it relates back to the filing of the original complaint so as to satisfy the statute of limitations. (Barrows v. American Motors Corp. (1983) 144 Cal. App.3d 1, 7 [192 Cal. Rptr. 380].)
Amendment has been allowed in numerous situations where the plaintiff knew the name of the defendant but did not know the capacity in which the defendant acted. (Wallis v. Southern Pac. Transportation Co., supra, 61 Cal. App.3d at p. 786 [plaintiff injured in railroad boxcar accident; plaintiff knew railroad company was involved but did not know who owned the boxcar or the name of the entity which had responsibility for maintenance and control of the boxcar]; Oakes v. McCarthy Co. (1968) 267 Cal. App.2d 231, 253 [73 Cal. Rptr. 127] [plaintiff knew a soil engineer was involved but did not know engineer's connection with the original filling and compacting operations]; Hollister Canning Co. v. Superior Court (1972) 26 Cal. App.3d 186, 198 [102 Cal. Rptr. 713] [plaintiff knew name of defendant who appeared on scene in connection with installation and inspection of equipment but plaintiff did not know in what capacity defendant rendered services]; Barrows v. American Motors Corp., supra, 144 Cal. App.3d at p. 10 [plaintiff knew American Motors Corporation promoted defective vehicle but did not know who designed, manufactured or distributed vehicle or know interrelationship of related corporations].)
Here, the explanation offered by appellant showed that when the original complaint was filed appellant was unaware respondent was the general contractor rather than merely one of numerous subcontractors. Respondent contends this is insufficient to show appellant was unaware of facts giving rise to his cause of action against respondent. We conclude, however, that the previously unknown fact respondent was the general contractor provides a proper new factual basis for a cause of action. If a general contractor has control over the premises and has knowledge that the negligence of a subcontractor has created a condition dangerous for third persons who foreseeably may come onto the premises, the general contractor may be *517 liable, even though the hazard was created by a subcontractor. (Gardner v. Stonestown Corp. (1956) 145 Cal. App.2d 405, 412 [302 P.2d 674]; Caswell v. Lynch (1972) 23 Cal. App.3d 87, 91-92 [99 Cal. Rptr. 880].)[3]
Appellant's belated discovery that respondent was the general contractor is analogous to the cases cited, ante, page 516, where a plaintiff knew the defendant's identity but belatedly learned the defendant acted in a different capacity than plaintiff knew at the time of filing the original complaint.
The authorities cited by respondent are not as closely analogous and are distinguishable. (Stephens v. Berry (1967) 249 Cal. App.2d 474, 477, 479 [57 Cal. Rptr. 505] [plaintiff knew the names and the facts surrounding both defendants' involvement in car accident, but apparently mixed them up and named the wrong one as the party who rear-ended the plaintiff]; Lipman v. Rice (1963) 213 Cal. App.2d 474, 477, 479, 480 [28 Cal. Rptr. 800] [in an action for malicious interference with a contract of employment and for slander, plaintiff knew the identity of defendant Rice and that Rice had acted adversely to plaintiff in the alleged conspiracy]; Von Gibson v. Estate of Lynch (1988) 197 Cal. App.3d 725, 730 [243 Cal. Rptr. 50] [plaintiff's ignorance that the defendant had insurance coverage is not ignorance of facts giving rise to a cause of action]; Miller v. Thomas (1981) 121 Cal. App.3d 440, 445 [175 Cal. Rptr. 327] [automobile driven by known city employee collided with plaintiff's automobile; plaintiff made deliberate tactical choice to sue the city only, as employer, and not to sue the employee individually]; Scherer v. Mark (1976) 64 Cal. App.3d 834, 840-841 [135 Cal. Rptr. 90] [hospital patient sued hospital and its employees for failing to watch over her while she took a bath and for failing to provide a safe place to take a bath; belated attempt to add the doctor who admitted her to the hospital was a sham in light of failure to show discovery of new facts regarding prescribed drugs and instructions for patient's care]; see also Dover v. Sadowinski (1983) 147 Cal. App.3d 113, 117 [194 Cal. Rptr. 866] [medical malpractice action against several defendants; plaintiff admitted knowing doctor's name and knowing doctor's involvement but made vague allegation that plaintiff had no idea "how deeply" doctor was involved]; Hazel v. Hewlett (1988) 201 *518 Cal. App.3d 1458, 1464-1465 [247 Cal. Rptr. 723] [on conflicting evidence trial court found plaintiff knew second dentist's name and second dentist's capacity as associate of first dentist].)
Respondent suggests it is "legally impossible" for respondent to be both a named defendant in the original complaint and Doe I in the original complaint, contending the categories are mutually exclusive. This contention is not persuasive in light of well-established law allowing a plaintiff to amend under Code of Civil Procedure section 474 when the plaintiff later discovers that a person whose name was known had a different legal capacity. (Wallis v. Southern Pac. Transportation Co., supra, 61 Cal. App.3d at p. 786.) The fact that in this case appellant, in ignorance of the true facts, actually named then dismissed respondent as a defendant should not make a difference. Respondent's interpretation is contrary to the beneficial purpose of the statute. (Larson v. Barnett (1950) 101 Cal. App.2d 282, 289 [225 P.2d 297].)
The order sustaining the demurrer to the amendment to the complaint is modified by adding a paragraph dismissing the action as to respondent. That order of dismissal is reversed. Costs on appeal are awarded to appellant.
Turner, P.J., and Grignon, J., concurred.
NOTES
[1]  There is a preliminary question about the appealability of this matter. The trial court signed an order sustaining the demurrer without leave to amend. The notice of appeal recites that it is from the order sustaining demurrer and from the judgment entered. During preparation of the record on appeal it was discovered that the superior court file contains no formal judgment. An order sustaining a demurrer is not an appealable order. (Code Civ. Proc., § 904.1.) However, in sustaining the demurrer without leave to amend the trial court obviously intended to make a final disposition as to this defendant. (Dominguez v. City of Alhambra (1981) 118 Cal. App.3d 237, 242 [173 Cal. Rptr. 345].) The merits have been fully briefed. In the interest of judicial economy we exercise our power to modify the trial court's order to make it a judgment, construe the appeal to apply to that judgment and then reverse. (Varjabedian v. City of Madera (1977) 20 Cal.3d 285, 289, fn. 1, 299 [142 Cal. Rptr. 429 [572 P.2d 43]; Wilson v. Household Finance Corp. (1982) 131 Cal. App.3d 649, 651-652, 655 [182 Cal. Rptr. 590].)
[2]  The procedural posture of this case is somewhat muddied because in opposition to respondent's demurrer, which was based on the face of the original complaint, appellant submitted a declaration. However, it is error to sustain a demurrer without leave to amend, if there is any reasonable probability the complaint can be amended to state a good cause of action. (Youngman v. Nevada Irrigation Dist. (1969) 70 Cal.2d 240, 244-245 [74 Cal. Rptr. 398, 449 P.2d 462].) Since we conclude the declaration of appellant's counsel shows appellant can allege facts entitling him to name respondent as a previously sued Doe, it was error to sustain the demurrer without leave to amend.
[3]  The authorities cited by appellant are not precisely in point because they involve the duty of a general contractor under former Labor Code section 6304 toward employees of a subcontractor. (E.g., Revels v. Southern Cal. Edison Co. (1952) 113 Cal. App.2d 673, 678-679 [248 P.2d 986]; Gonzales v. Robert Hiller Const. Co. (1960) 179 Cal. App.2d 522, 530 [3 Cal. Rptr. 832].) Appellant may have been an employee of TRW or of a security service rather than an employee of a construction subcontractor. A general contractor, however, has a duty of due care toward all third persons the contractor may reasonably expect to be affected by the work. (McCall v. Otis Elevator Co. (1963) 219 Cal. App.2d 22, 27, 30 [33 Cal. Rptr. 44] [employee of hospital injured by condition of elevator shaft under construction].)
