Added automatic page adding when clicking on a link