fixed some bugs with the chart