Fix bug on pagination