Fixed bug on total