Added destructor function