Chat js improvements