fix bug on pagination()