added pagination to the pages