Added chat save function