Fixed login check