removed sorting from count queries