fixed legend problem