fix a pagination bug