use correct method to get hostname