I modified wait to rethrow all exceptions