working pagination for results