added wait timeout to rpc blocking loop