use localStorage for state

fixes shared state between pages