Fixed an issue with creating the page model before scripts were loaded