close handles after opening them