—Order, Supreme Court, New York County (Sheila AbdusSalaam, J.), entered March 26,1999, which granted defendant’s motion to dismiss the complaint for failure to state a cause of action, and denied plaintiffs request that the motion be *320transferred to another Justice, unanimously affirmed, without costs.
The action is by plaintiff law firm against defendant insurance company to recover fees for legal services rendered to the insureds of another insurance company that was closely affiliated with defendant and is now in liquidation, namely, Galaxy Insurance Company. Lacking privity with defendant, plaintiffs contract claim is based on Certificates of Suretyship included in some of Galaxy’s policies, in which defendant agreed to assume Galaxy’s responsibilities under a policy in the event of Galaxy’s insolvency, contingent upon “the insured’s” executing and delivering whatever agreements or evidences of subrogation defendant might demand respecting payments made or liabilities assumed. The contract claim was properly dismissed since it is clear that defendant’s obligation under the Certificates ran only to Galaxy’s insureds. While the responsibilities defendant assumed under the Certificates to Galaxy’s insureds presumably included provision of a defense, it does not follow that defendant assumed Galaxy’s obligation to pay plaintiffs fees. Galaxy’s obligation to pay plaintiffs fees did not stem from its insurance policies but from its independent retainer agreement with plaintiff. Plaintiff also fails to state a cause of action for account stated, there being nothing in the complaint to indicate that defendant ever expressly or impliedly agreed that it owed plaintiff anything (see, Interman Indus. Prods. v R. S. M. Electron Power, 37 NY2d 151, 153-154). Nor does plaintiff state a cause of action in quantum meruit, such being precluded by the existence of plaintiffs valid written contract with Galaxy governing its retainer (see, Clark-Fitzpatrick, Inc. v Long Is. R. R. Co., 70 NY2d 382, 388). We also reject plaintiffs argument that, under CPLR 2221, the motion should have been referred to another Justice who, in the course of dismissing, without prejudice, a prior, identical action on the ground that plaintiff failed to specify the particular matters covered by a Certificate, opined that “plaintiff may have a claim” against defendant. Such prior order created no law of the case establishing the sufficiency of the complaint, and nothing in the instant motion had the potential of affecting the prior directive that plaintiff specify the matters covered by Certificates. Concur — Sullivan, P. J., Rosenberger, Williams, Wallach and Friedman, JJ.