update destroy function