fixed sign in logic