fix a bug of editting file