added subdomain support with validation