Bug fixed in total method