Fix missing model.json file and window.onload on wrong function