modified editElement() for an edit-cancle-button's bug