now works with long polling