Fix bug where scrolling causes graphs to multiply