added example to store the scroll position