fixes a bug when editing a menu item outside of a modal