fix countOfRecords error