moved odr closing  to destructor