Use a more reliable method to get the domain string