main legend fix