modify menu widget and fix some bugs