Added chat.close() call to CLI