added automated error handling to waitReady
added error handling to waitReady