[User] Slightly modify the chat.js to allow better portability