Upon the death of either parent, the survivor is entitled to custody of the child; provided, however, that the judge, upon petition: (1) May exercise discretion as to the custody of the child, looking solely to the child’s best interest and welfare; and (2) In the case of a surviving parent being criminally indicted for the offense of murder or voluntary manslaughter of the other parent, can proceed in the court’s discretion.