Remove explicit references to Main.panelManager.panels[1] because it might not exist