Fix bug on legend