cherry pick of inventory check and restart