replace sleep() with fast poll