fixed switch loading only on document.ready instead of document.on page:change