Updated how the hostname is fetched