Solve legend bug with ID