repaint only when value actually changes