detect timeout from main thread