bar chart code need to fix some error