Fixed login verify function