Changed to get the  domain automatically