add close button on legend