added wait timeout