edited the way finding what domain the page is run from is done