Fixed number of records count bug