added validator
finished tests for validator