fix chart not updating in real-time