bug fix in destroy method