simplified using wait till set