working through state issues when moving from one page to the next and then back