handle cases where target hostname can be null