adding legend toggle