fixed error with validation