minor bugfix that makes addlegend work better, i think