It now uses the page index the menu (that was used to delete) belongs to, instead of the selected page index.