Implemented long-polling for chat