handle pagination for topics