Fix sign in sign out logic