updated to deal with multiple domains