colors in map legend were getting lost when toggling