added long polling and asynchronous chat functionality