changed a bit the way pagination works.