fix to pie chart refresh code