fixed sorting of total column