fix legend positioning issue