fix a bug in MainFrame