switch host parsing to urlparse