If an order is issued by a judge committing to a state institution a person who has not acquired a legal residence in this state, the cabinet shall return such person, either before or after his admission to the institution, to the country or state to which he belongs and for such purposes may expend so much of the money appropriated to it as is necessary.
KRS 210.350