fix legend issues