added catch to catch Invalid Menuitem