Fix error when sign in and sign out