Fix some bug on pagination