fix mainpanel