Added handlers to only count the number of records