Why is magnesium is added to a solution to check for acidity?