added unit option in validator and removed duplicate error messages