move clear_menu_item to lua implementation