add toggle for legend