fix a bug in edition mode