destroy adddialog before calling add_device