Added polling code