fixed validation for search