fix a bug on charts loading