add doc about mode, and add change mode code