A corrosion inhibiting layer to tackle the irreversible lithium loss in lithium metal batteries