Added destroyObject method.