fixing total bug