fix error in destroy handler