Fix loadPage implementation in SmartApp.js template