Updated chat functions.