Pharmacology

In antacid preparation aluminum hydroxide is added with magnesium salt because -