remove legend on rerender