Small change to MainFrame to fix bug.