fixed bug with the total counts