fix bugs on FormMain