add tests for validation error handling