Finish get_id_by_name function