waitComplete function