Fixed bug in pollUntilReady