added logic to index pages for each category