Fixed login loop