This was copied from delete_selected_items() above; I added a var there as well