wait for device is ready.