avoid paginate count when no results

In case of no results, i would think the count query is not really needed