added async support with polling and listening