Fix bug: output error message on validation fails