fixed the legend table