Application by respondent’s former wife, individually and as guardian ad litem for their two infant children, for a temporary injunction restraining respondent from molesting her or said children; for a permanent injunction so restraining him and, also, restricting his visits with the children, and for an order modifying the visitation terms of the separation agreement between appellant and respondent declaring void a provision therein that in case of her remarriage custody of the children should revert to him at his option; and for counsel fees for appellant’s attorneys. Said separation agreement was incorporated into a foreign divorce decree, which continued the custody provisions of the agreement specifically, and all of its terms generally. Based upon the papers submitted by both sides, and except for the request for counsel fees, which it did not pass upon, the Special Term denied the application in all respects. Thereafter, upon appellant’s motion, the court granted reargument, and upon such reargument denied counsel fees and *812adhered to the original decision. The appeal is from the order, on reargument, insofar as it adheres to the original decision and denies counsel fees. Order modified so as to provide for a hearing with respect to the application to modify the separation agreement so as to restrict respondent’s rights of visitation to an extent to be fixed by the court. As so modified, order affirmed, without costs, and matter remitted to the Special Term for such hearing. The parties not being husband and wife, this is not a matrimonial action and there is no statutory authority for granting the counsel fees requested. (Dravecka v. Bichará, 267 N. Y. 180; Marshall v. Marshall, 281 App. Div. 976.) The paramount object of the separation agreement, apart from providing for support, was to determine custody of the children. Therefore, it may not be inferred that the provision regarding custody in the event of appellant’s remarriage was designed to prevent such an occurrence; and, consequently, said provision is not against public policy as an unreasonable restraint upon marriage. (Cf. Matter of Dettmer, 176 Mise. 512, affd. 262 App. Div. 1032, affd. 289 N. Y. 597.) In view of the conflicting claims concerning respondent’s conduct during his visits, a hearing should be held on this issue to ascertain the facts, so that the best interests of the children may be served. Adel, Acting P. J., Wenzel, Schmidt, Beldoek and Murphy, JJ., concur.