bug fixes on main table