fixing doubling of total bug