better disconnect handling for long poll mode