Added error messages when validation fails