changed destroy object logic