fix bug reported by @entomb about 'first' and 'last' buttons of the pagination not working