rewrite the ChatSystem