Reactions of methyl benzoate and methyl formate with hydrogen bromide and hydrogen iodide