search and paginate working together