fixed possible crash in edit