Fix searching of menu item from document.location