Fixed issue where legend may not show on initial load