putting in some defensive code if no wait is defined