added working pagination