A slightly more efficient wait procedure in doco