fix crash adding new device