bug with pagination when there are only two pages fixed