Added destructor function.