Fixed issue with re-opening legend dialog