added wait to the test