fixed the broken hide/show toggle for legend sections