added orientation handling and fixed sign-in