fixing search and refactoring validation type