moved closing of odr into destructor