detect event loop consistently