solving a minor bug in the piechart