this should be in an `ensure` block to make sure it will be reset.