fix some bug on main layout.