Fixed login method