cleanup
fix erratic error when hiding/showing layers in legend