fix log in log out button to be in the correct state on refresh of the page.