move function for county-province updating to global scope so it can be reused