added function for loading webpages and redirecting references