fixed multi-page query bug