Fixed bug causing legend to hide after redraw