Show pagination only when its needed