now stores state between form pages and catches browser back button behaviour