Change toMathML call to callback to avoid errors