add validates and unit tests