wait for device to be done