fixed segfault after edit
fixed segfault after edit