changed the way MAthJax loading was being chekced