do not test if the shortname exists, test if the shortname you gave on insertCountry() equals the value that $country->shortname holds.