handle wait timout without IllegalStateException