I am not entirely sure what the problem is?
This looks like a script problem, but here is what I am guessing is the problem:
You are trying to change the font using the tutorial you found, but the AMS you've found already provides a way to change the font that overrides the original method explained in the tutorial. Please link to the AMS.