fixed some more bugs in the pagination