small error in the chat.js was stopping the system from working , noticed that the error was in the message handler of the client in the first few lines , doubt that the issue is due to DOM elements not loading before execution