Changing the logic for getting domain