changed chat code