use jquery's document.ready to fix loading/parsing issues