Fixed login code