fix criteria conversion when an order by exists but we are calling for a count
reformat