Added a destructor for the Text class