patched menu_item_visibility to fix a known bug