fix a bug about editing mode.