fix bug on totals on index