function to set the selected country