add user login check function.