added support for polling timeout