Improvements to chat js