handle wait