fix chart adding bug