modify endEditing.