fix total
fix again
some bug fixes