refactoring long-polling and bug fixes