bug fix on destroy