Wait for device instead of cancel the script

Hope now everything is fine.