Adding waitForPollToRun method