Added destructor and finalizer