fixed some issued with handling long polling