Added code to set the initial scroll position based on active page.