improved waitfor checks