Title: Magnesium ions stabilizing solid-state transition metal hydrides