fix bug for validate