update capability storage to use try-with-resources for iterator autoclose