adding a function to get the page state at each page resize - needs re-thinking