window.addEventListener('load', function() {
  var $countryField = $($('.form-control.select2')[0]);
  if ($countryField && $countryField.hasClass('is-invalid')) {
    $('.select2-container').addClass('has-error');
  }
});