added handling for links in pages