fix legend issue