fixed bug with validation and test