Fixed legend problem