fix bug for validation