add subdomain swapping which resolves #247