update destroy function.