fixed paging query problem