fixes bug when editing a menu item outside of a modal