add long-polling support