Corrected the total number of records returned when ordering by column