changed MainPanel to MainFrame inner class