Fixed a bug in edit