Although it was error to remove the nonresident minor from the custodial parent, it was harmless where record shows substantial danger to the minor if returned. Jonathon Q. (father) was the presumed father of the minor, Anthony, and had sole legal and physical custody of him. However, at the time that the dependency petition was filed, Anthony had been living with a grandmother. The juvenile court removed Anthony from father’s custody after finding that there would be a substantial risk of danger to him to be returned to father’s home. On appeal, father contended that the juvenile court lacked authority to remove Anthony from his custody because Anthony was not residing with him at the time the petition was filed. The appellate court found that the juvenile court erred in removing Anthony from father’s custody pursuant to section 361, subdivision (c). The court concurred in the Dakota J. court’s interpretation of the statute, which is that the statute does not contemplate removal of a child from a parent who was not living with the child at the relevant time. (In re Dakota J. (2015) 242 Cal.App.4th 619). However, section 361, subdivision (c) is not the only authority the juvenile court has to make orders reasonably necessary to address the problems which led to the dependency proceedings or to protect the minor. The court is authorized under section 361, subdivision (a) and 362, subdivision (a) to remove a child from a parent’s custody if it would pose a substantial danger to the safety of a child to return him or her to a currently nonresident custodial parent. Therefore, the juvenile court’s error was harmless.