implemented subdomain functionality