add recursive destroy function in edit mode