fix crashes related to subdomains