legend fix issue #2266