fixed legend behaviour