Refactor pagination
Fix pagination