fixed sign-in/sign-up/sign-out logic