handled case of records = 0