fix bug on validation