resolve mainform bug