Fix bug with total count