corrected validation for search