resolving registry resource delete failure at first attempt
merging code review feedback