fixed missing legend bug