implement login verify function