fix chart insert bugs