updated js to work with links in page