Modify destroy function.