work for search box and pagination.