Fix hasError replaced by isValid
Delete log
Delete useless code