Added close() to destructor.