add total at index