fixed a pagination bug for filtered results