added link handling and paging